By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,463 Members | 1,528 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,463 IT Pros & Developers. It's quick & easy.

About dialog

P: n/a
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
Jul 7 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On Mon, 07 Jul 2008 05:41:04 -0700, Tony Johansson
<jo*****************@telia.comwrote:
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 ?
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.

Pete
Jul 7 '08 #2

P: n/a
On Jul 7, 9:32*am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
I just want to know if a dialog is the same as a form ?

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
Jul 7 '08 #3

P: n/a
On Mon, 07 Jul 2008 16:23:17 -0700, raylopez99 <ra********@yahoo.com>
wrote:
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"
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).

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.
that's a sort of macro to pass information to and from the user.
The message map used macros to declare it yes, but I don't understand what
you mean by "pass information to and from the user". The message map
simply defined what code was executed in response to certain messages sent
to the window. It didn't "pass information" at all, never mind "to and
from the user".

Not that any of this has anything to do at all with Tony's question.

Pete
Jul 8 '08 #4

P: n/a
On Mon, 07 Jul 2008 12:41:04 +0000, Tony Johansson wrote:
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
Jul 8 '08 #5

P: n/a
On Jul 8, 12:38*am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
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.
>
that's a sort of macro to pass information to and from the user.

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

Jul 9 '08 #6

P: n/a
On Wed, 09 Jul 2008 02:20:15 -0700, raylopez99 <ra********@yahoo.com>
wrote:
On Jul 8, 12:38*am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
>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.
What analogy? By your own admission, message maps have nothing to do with
..NET dialogs or Tony's question at all.

Please do not confuse topics by introducing new, irrelevant information.
It's not helpful
[...]
> but I don't understand what *
you mean by "pass information to and from the user". *

Your not understanding is not my problem.
Inasmuch as it suggests your statement was poorly worded or otherwise
failed to convey whatever meeaning you intended, it's your problem.
Unless, of course, you enjoy just writing random words that are
meaningless to others. If so, then yes...my understanding is not your
problem.

Pete
Jul 9 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.