I used a button click event to call the dialog box as follows:

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 ...
    }
    }

how can I specify the icon image from a given folder to show on the dialogbox ?

有帮助吗?

解决方案

try:

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 ...
   }
}

But it will change the image inside the dialog box, (if you want to change the icon of the dialog caption - i think it is not possible without modifying BetterDialog code)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top