0

我使用了一个按钮单击事件来调用对话框,如下所示:

private void btnDialog_Click(object sender, EventArgs e)
    {
    DialogResult result = BetterDialog.ShowDialog("Special Dialog", "large heading", "small explanation", null, "Ok", ***null***);
    if (result == DialogResult.OK)
    {
    // Action to perform ...
    }
    }

如何指定给定文件夹中的图标图像以显示在对话框中?

4

1 回答 1

1

尝试:

private void btnDialog_Click(object sender, EventArgs e)
{
   DialogResult result = BetterDialog.ShowDialog("Special Dialog", "large heading", "small explanation", null, "Ok", Image.FromFile(@"fullPath\FileName.ext"));
   if (result == DialogResult.OK)
   {
   // Action to perform ...
   }
}

BetterDialog但它会改变对话框内的图像,(如果你想改变对话框标题的图标——我认为不修改代码是不可能的)

于 2012-07-16T23:12:49.450 回答