2012-07-16 91 views
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 ... 
    } 
    } 

如何從一個給定的指定文件夾的圖標圖像顯示在對話框?

回答

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代碼)

+0

是的,沒錯。非常感謝。 – 2012-07-16 23:16:27