About dialog

T

Tony Johansson

Hello!

I know there exist some commonDialogs in .NET
such as SaveFileDialog,OpenFileDialog printDialog and so.

I just want to know if a dialog is the same as a form ?
I mean when these dialogs was created it uses
the form as the base for creating these dialog.

When I create a window form application I use form to create the window.
I can't use dialog to create a window except for these common dialogs that
is
passed along with the .NET.

//Tony
 
R

raylopez99

Yes and no.  For your purposes, mostly yes.  You can design a dialog  
exactly as a form, using the Visual Studio Designer.  Then, instead of  
calling Form.Show() to display the form, call Form.ShowDialog().  That  
will display the form as a modal window, just as any dialog would be shown.

I agree with this statement, that Dialog Boxes** are just Forms that
pass and/or return data and return a DialogResult*, but for historical
reasons a dialog also has imbedded in it a so-called "message map"
that's a sort of macro to pass information to and from the user. At
least that's the way I think of it, based on Visual C++ MFC, which had
such a macro that you could not edit, but was generated by the VS
wizard.

RL
[resident C# n00b 'expert' or MVP of sorts]

* DialogResults include: Ignore, No, None, OK, Retry and Yes

** Common Dialog Boxes include: ColorDialog, FolderBrowserDialog,
FontDialog, OpenFileDialog, PageSetupDialog, PrintDialog and
SaveFileDialog
 
K

Ken Foskey

Hello!

I know there exist some commonDialogs in .NET such as
SaveFileDialog,OpenFileDialog printDialog and so.

I just want to know if a dialog is the same as a form ? I mean when
these dialogs was created it uses the form as the base for creating
these dialog.

When I create a window form application I use form to create the window.
I can't use dialog to create a window except for these common dialogs
that is
passed along with the .NET.

I just added an about box today, VS 2008. It was simply a matter of
adding to the project an about box and then creating an instance of it in
the form. In my case on click in the menu.

If you set the owner of the aboutbox form to this when you create it, it
behaves like a dialogue box because you must close the about box for the
owner form to become active.

Ken
 
R

raylopez99

MFC message maps applied to any kind of window, not just dialogs, and they  
have basically nothing at all to do with .NET development (.NET uses  
events, and in particular Click events for most situations where you'd  
have a message map entry in MFC).

We know that Peety. I was simply making an analogy.

The message map was something that MFC used in the message processing for 
the window, and it was not at all "embedded" in a dialog.  It was part of  
the code supporting the dialog.  And again, completely irrelevant for .NET.

"embedded" vs. "code supporting"--same thing.
The message map used macros to declare it yes,

Yes, so you finally agree.
but I don't understand what  
you mean by "pass information to and from the user".  

Your not understanding is not my problem.
Not that any of this has anything to do at all with Tony's question.

That's true, so let's not waste anymore time in this thread with your
or my misunderstandings.

RL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top