Looking for the elegant "Dont Show Me This Dialog Again" Dialog in C #

I was looking for a dialog with the “Don show me this dialog again” checkbox in C #.

I googled and searched a lot, but I just could not find an elegant solution.

The dialog should work just like the native MessageBox.Show, but with a new property value (bool value) is returned to the caller.

Thanks.

+6
c # showdialog dialog
source share
3 answers

Vista and Windows 7 applications can use the new TaskDialog features that extend the standard MessageBoxes to support the checkbox below (along with all sorts of other useful features such as Command Links, custom button text, footers, etc.).

alt text

Unfortunately, from C # you need to do some kind of interop to access this. If you want advanced TaskDialogs to target Vista / Windows 7, use the WindowsAPICodePack from http://code.msdn.microsoft.com/WindowsAPICodePack , which can handle the complexity of the interaction for you.

If you need XP support, there is a great shell that supports native TaskDialogs on Vista / 7 using WinForms backup for XP here: http://www.codeproject.com/KB/vista/Vista_TaskDialog_Wrapper.aspx

+6
source share

Why don't you create your own. It is very simple. Just infer from the System.Windows.Forms.Form class and mimic it as the one you need.

+3
source share

I don’t feel that there will be a ready-made solution as such. To implement "Do not show me again" you need to save the information outside the dailog, as well as create a user profile.

If your user profile persistence framework exists, you can simply create a class similar to the messagebox class. However, you cannot receive the messagebox .

0
source share

All Articles