Textbox validation, esc key

M

Marko Bozikovic

Hi all,

I have a bit of a problem...

I have a simple modal form with some textboxes. I handle Validating event for
some of them, to check data format.

Form has OK and Cancel buttons, AcceptButton and CancelButton properties set.
Cancel's CausesValidation is set to false.

When I click the Cancel button, validation event is not fired and form closes
even if current textbox contains invalid data. However, when I press Esc key,
validation event is fired and the form will not close if current textbox
contains invalid data.

I didn't have any luck finding a standard way of handling this. Can anyone help?

TIA,
--
Marko
ICQ: 5990814

I'm not under the alkafluence of inkahol
that some thinkle peep I am.
It's just the drunker I sit here the longer I get.
 
P

Patrick Steele

Hi all,

I have a bit of a problem...

I have a simple modal form with some textboxes. I handle Validating event for
some of them, to check data format.

Form has OK and Cancel buttons, AcceptButton and CancelButton properties set.
Cancel's CausesValidation is set to false.

When I click the Cancel button, validation event is not fired and form closes
even if current textbox contains invalid data. However, when I press Esc key,
validation event is fired and the form will not close if current textbox
contains invalid data.

I didn't have any luck finding a standard way of handling this. Can anyone help?

http://tinyurl.com/ypxof7
 

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