Custom Dialog Result ???

  • Thread starter Thread starter Nathan
  • Start date Start date
N

Nathan

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.
 
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
 
* "Nathan said:
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.

Add a property to the form (of an enum type), set its value and check
the property after closing the form.
 
Hi Nathan... I missed your original message and I see you have some
responses to:

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
 
Back
Top