textbox changes

  • Thread starter Thread starter Hrvoje Voda
  • Start date Start date
H

Hrvoje Voda

I have 4 textBoxes.
I would like to see if a user has write something in any of them, so that I
can ask him to save it into dataset.
How could I check for all 4 at once, so I don't have to ask for every one in
single ?

Hrcko
 
Hrvoje Voda said:
I have 4 textBoxes.
I would like to see if a user has write something in any of them, so that
I can ask him to save it into dataset.
How could I check for all 4 at once, so I don't have to ask for every one
in single ?

Hrcko

Hi. Catch the TextChanged event in all of the text boxes and set a boolean
in your code that the text has changed. If you wish, you could send the
event for all of the text boxes to the same event handler, to avoid
duplication.

-- Alan
 
Hrvoje Voda said:
I put a bool into TextChanged event but it's always true.

Hi. The TextChanged event will get fired also when you are loading the
textbox programatically. You need to make sure that you initialize your
boolean to false AFTER you have done the initial loading of the textbox
contents, but BEFORE the user has a chance to change them.

-- Alan
 
Back
Top