all groups > vb.net > november 2003 >
You're in the

vb.net

group:

Custom Dialog Result ???


Re: Custom Dialog Result ??? Cor
11/30/2003 9:57:10 PM
vb.net:
Hi Nathan,

I asume you use a dialogform
that goes something as this
\\\
frm as new form2
frm.showdialog
///
Then you can do
\\\\
if frm.myMessagefield = "Hello Nathan"
then DoHelloNathan
end if
frm.dispos
///

In your form2 you need therefore
public myMessagefield as string
(You can do it with a property but that is for me to much work for a
dialogform).

and somewhere in your dialog
myMessagefield="Hello Nathan"

I hope that was your question?

Cor

[quoted text, click to view]

Custom Dialog Result ??? Nathan
11/30/2003 10:25:35 PM
I have a form in which a user clicks a button to make a choice, and that
choice is evaluated after the form is closed. Is there a way to create
custom dialog results, that is, dialog results other than OK, Cancel, Retry,
etc.? I know of other ways to work it, but I was just wondering if this
were possible.


Re: Custom Dialog Result ??? hirf-spam-me-here NO[at]SPAM gmx.at
11/30/2003 10:47:09 PM
* "Nathan" <nkmacgregor.TakeThisOut@softhome.net> scripsit:
[quoted text, click to view]

Add a property to the form (of an enum type), set its value and check
the property after closing the form.

--
Herfried K. Wagner [MVP]
Re: Custom Dialog Result ??? Tom Leylan
11/30/2003 11:21:06 PM
"Nathan" <nkmacgregor.TakeThisOut@softhome.net> wrote...

Hi Nathan... I missed your original message and I see you have some
responses to:

[quoted text, click to view]

As you probably noticed the results of showdialog must be one of the
predefined DialogResult enums. On the other hand it seems to me you could
easily wrap your form which you intend to use as a dialog window. Call it
instead, have it display the dialog and have it do any additional
interpretive work you need eventually returning just the value you wanted.

Tom


Re: Custom Dialog Result ??? Nathan
12/1/2003 5:50:08 AM
Thanks a lot. I'll give it a try and see if it works.

[quoted text, click to view]

Re: Custom Dialog Result ??? Nathan
12/1/2003 5:51:04 AM
Not exactly what I was hoping to do, but I think it will work easy enough.
Thanks.


[quoted text, click to view]

AddThis Social Bookmark Button