tags:

views:

663

answers:

4

In VB.NET is there a library of template dialogs I can use? It's easy to create a custom dialog and inherit from that, but it seems like there would be some templates for that sort of thing.

I just need something simple like Save/Cancel, Yes/No, etc.

Edit: MessageBox is not quite enough, because I want to add drop-down menus, listboxes, grids, etc. If I had a dialog form where I could ask for some pre-defined buttons, each of which returned a modal result and closed the form, then I could add those controls and the buttons would already be there.

A: 

Are you unable to use the MessageBox class?

Geoffrey Chetwood
+2  A: 

Do you need something more than what can be provided by MsgBox?

MsgBox("Do you want to see this message?", MsgBoxStyle.OkCancel + MsgBoxStyle.Information, "Respond")
Galwegian
Ahhh yes, he did say VB.NET, oh well. Either way, these should work for him.
Geoffrey Chetwood
A: 

Of course there's MessageBox (shorthand MsgBox in VB.Net) and also the windows common dialogs like Open File, Save File, Print, ColorPicker, etc.

However, none of those really qualify as templates.

I can sympathize with wanting a better message box from time to time. You might try code project: I'll bet you'll see a dozen...

Joel Coehoorn
+1  A: 

Why not create your own template? I've done that with several types of forms, not just dialogs. It is a great way to give yourself a jump-start.

Create your basic dialog, keeping it as generic as possible, then save it as a template.

Here is an article that will help you:

http://www.builderau.com.au/program/dotnet/soa/Save-time-with-Visual-Studio-2005-project-templates/0,339028399,339285540,00.htm

And:

http://msdn.microsoft.com/en-us/magazine/cc188697.aspx

camainc
Thanks, I've been doing that and I agree it's easy. I was just wondering if there was a generic template out there. Thanks for the quick answer!
JosephStyons
If all you are looking for are simple things like yes/no, ok/cancel, you should really consider just using the built in functionality of the MessageBox (msgbox) class.
Geoffrey Chetwood
I do not understand what is wrong with the MessageBox class that makes you refuse to use it.
Jon Limjap
Please see my comment in the original post
JosephStyons