T
TheSteph
Hi Experts !
I have a Winform Program in C# / .NET 2.0
I would like to ensure that a value in a TextBox is a valid Int32 when user
get out of it (TextBox loose focus)
BUT : The "Validating" Event of a TextBox does NOT fire when user click on
controls like ToolStripButton, ToolStripMenu,.. (in fact Validating event is
fired AFTER the Click event of the ToolStripButton, so it's too late to
check...)
In this kind of case, does it mean that a programmer using .NET MUST check
at more than one place that the value in a given TextBox is a valid Integer
? (Once in the validating event, and Once in EACH ToolStripButton(menu,..)
Click) ???
If no : HOW CAN I DO to check if a TextBox have a valid Int32 value when
TextBox loose focus AND when user click on a ToolStripButton (or menu)
?????????
If yes : How can MS think that it's a good programming practice and modern
to check the same basic and simple thing at different places in the same
form. Why this kind of problem in the "Third version of their very last
programming language" ?
Any solution is welcome and will save me a lot of headache..
Steph
I have a Winform Program in C# / .NET 2.0
I would like to ensure that a value in a TextBox is a valid Int32 when user
get out of it (TextBox loose focus)
BUT : The "Validating" Event of a TextBox does NOT fire when user click on
controls like ToolStripButton, ToolStripMenu,.. (in fact Validating event is
fired AFTER the Click event of the ToolStripButton, so it's too late to
check...)
In this kind of case, does it mean that a programmer using .NET MUST check
at more than one place that the value in a given TextBox is a valid Integer
? (Once in the validating event, and Once in EACH ToolStripButton(menu,..)
Click) ???
If no : HOW CAN I DO to check if a TextBox have a valid Int32 value when
TextBox loose focus AND when user click on a ToolStripButton (or menu)
?????????
If yes : How can MS think that it's a good programming practice and modern
to check the same basic and simple thing at different places in the same
form. Why this kind of problem in the "Third version of their very last
programming language" ?
Any solution is welcome and will save me a lot of headache..
Steph