MessageBox.Show() Custom Icon?

2019-01-11 11:19发布

I want to use a custom icon in MessageBox.Show("Message", "Title", MessageBoxButton.OK, MeesageBoxIcon.myIcon) Method.

Any suggestion please?

4条回答
男人必须洒脱
2楼-- · 2019-01-11 11:44

You can use Task Dialog Indirect API from Microsoft, which will help you to show custom dialogs.

查看更多
The star\"
3楼-- · 2019-01-11 11:46

You can't override this behavior of MessageBox. The solution is either use some custom message box, check this, or implement your own MessageBoxForm and add your custom settings to it, check this.

查看更多
Fickle 薄情
4楼-- · 2019-01-11 11:48

You can not directly change an icon of MessageBox so I googled it and I found the solution for that. we can change an icon of message box using window hook.

Hear is the MSDN Magazine link.

MSDN on the Internet archive

查看更多
欢心
5楼-- · 2019-01-11 11:58

I wrote one a little while ago, it works exactly like the regular messagebox class.

CustomMessageBox (Class): http://pastebin.com/m8evBmZi

MessageForm (Form): http://pastebin.com/jawHZDzY

MessageForm (Designer Code): http://pastebin.com/CRXjeUFN

查看更多
登录 后发表回答