PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Re: Try Validating Event
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Re: Try Validating Event
![]() |
Re: Try Validating Event |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
The suggestion I saw somewhere for menues was to add a Form.Validate() call
to the menuitem event handlers. David "Guido Stinnez" <Guido.Stinnez@tria.de> wrote in message news:056801c31ae1$88408780$a001280a@phx.gbl... > Hi Ramana > > try using the Validating Event instead of the Leave Event, > it needs a CancelEventHandler and sends CancelEventsArgs, > where you can set the Cancel Property to true. > WindowsForms then automatically return to the invalid > control without doing anything else. > But careful - the event doesnt seem to get fired, if you > do anything outside of the form in question, like menu or > let alone hotkeys; nor does the leave event > So if anyone knows what to do about that, > Help deeply appreciated : ) > Guido > > > > >-----Original Message----- > >I am using a list view and some textboxes on the form. I > am validating the > >textbox contents in textbox leave event and setting the > focus back to the > >same text box if the data is wrong. > >If I click on the listview item after typing some wrong > data in the text > >box, It does the validation and setting the focus to the > same textbox, but > >surprisingly the 'SelectedIndexChanged' event of the > listview also gets > >fired leading to undesirable side effects. When the data > is wrong, normally > >I do not want to perform any other action like selecting > an item in the list > >view etc. > > > >We have used the list view to display some information > and the textboxes to > >display the information of selected list view item for > editing. we would > >like to validate the data in the text boxes before > selecting another item in > >the list view. How to restrict the selection of another > item in the listview > >when the validation fails. This is very urgent > > > >Advance Thanks > > > >Ramana > > > > > >. > > |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Sorry, this garbage got posted to the wrong spot.
David "David Rogers" <dwrogers@u.PASDUSPAM.washington.edu> wrote in message news:OydXD%23uODHA.3408@tk2msftngp13.phx.gbl... > The suggestion I saw somewhere for menues was to add a Form.Validate() call > to the menuitem event handlers. > > David > > "Guido Stinnez" <Guido.Stinnez@tria.de> wrote in message > news:056801c31ae1$88408780$a001280a@phx.gbl... > > Hi Ramana > > > > try using the Validating Event instead of the Leave Event, > > it needs a CancelEventHandler and sends CancelEventsArgs, > > where you can set the Cancel Property to true. > > WindowsForms then automatically return to the invalid > > control without doing anything else. > > But careful - the event doesnt seem to get fired, if you > > do anything outside of the form in question, like menu or > > let alone hotkeys; nor does the leave event > > So if anyone knows what to do about that, > > Help deeply appreciated : ) > > Guido > > > > > > > > >-----Original Message----- > > >I am using a list view and some textboxes on the form. I > > am validating the > > >textbox contents in textbox leave event and setting the > > focus back to the > > >same text box if the data is wrong. > > >If I click on the listview item after typing some wrong > > data in the text > > >box, It does the validation and setting the focus to the > > same textbox, but > > >surprisingly the 'SelectedIndexChanged' event of the > > listview also gets > > >fired leading to undesirable side effects. When the data > > is wrong, normally > > >I do not want to perform any other action like selecting > > an item in the list > > >view etc. > > > > > >We have used the list view to display some information > > and the textboxes to > > >display the information of selected list view item for > > editing. we would > > >like to validate the data in the text boxes before > > selecting another item in > > >the list view. How to restrict the selection of another > > item in the listview > > >when the validation fails. This is very urgent > > > > > >Advance Thanks > > > > > >Ramana > > > > > > > > >. > > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

