Dialog Box

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

Hello, I am trying to create my own little dialog box. Prior to returning, I
want to ensure the information keyed in my dialog box is correct. If not
correct, then the user must correct or cancel out of the dialog box.

I set the "Cancel" button "DialogResult" property to cancel. The other button
I set the DialogResult property to OK, BUT ONLY AFTER IT PASSES THE
VALIDATION. Evidently this property has to be set prior to the button being
clicked and if set within the button click event then requires the button to
be clicked again.

I thought I would create a hidden button and set it DialogResult Property to
"OK" and then raise the event within the other buttons click event after I
determined that all the edits had been passed. When I enter the "RasieEvent
cmdExit.Click (sender, e)" the editor does not like it and says cmdExit is not
an event within the class.

So can I not raise another buttons click event?

Is there a better technique for doing this?

Thanks in advance for your assistance!!!!!!!!!!
 
Hi Jim,

Make a standard button, don't set it's dialog result though. Run your
validation code and when you want to return an OK result, use

Me.DialogResult = DialogResult.OK

Okay?

Nick.
 
That worked just fine...

Thanks!!!!!!!

Nak said:
Hi Jim,

Make a standard button, don't set it's dialog result though. Run your
validation code and when you want to return an OK result, use

Me.DialogResult = DialogResult.OK

Okay?

Nick.
 
Thanks
Nak said:
Hi Jim,

Make a standard button, don't set it's dialog result though. Run your
validation code and when you want to return an OK result, use

Me.DialogResult = DialogResult.OK

Okay?

Nick.
 
No probs Jim.

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Having problems with you job?
You're marriage is on the rocks?
You can't sleep at night?
You have a drink and drugs addiction?
You are sexually impotent?
Then enable Option Strict!
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 
Back
Top