Checking For Changed Text
I have 22 text boxes that have to be checked to see if the value has changed. I am using the TextChanged Event handler to do this thus:
Code:
Private Sub TextStringChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
DataChanged = True
RemoveHandler ........
RemoveHandler ........
Etc ......
End Sub
The Handler would be added after the data had been loaded. The question is:
Is there another way of checking for text changes without having to add and remove 22 handlers.
Computerman :)
Re: Checking For Changed Text
I'm pretty sure you could, after the text changes, make a string variable and also check it at an occasion, like "If source == ChangedText then..." or something like that.
Re: Checking For Changed Text
In one textchange handler you can do handles textbox1.textchange,textbox2.textchange,textbox3.textchange
...etc
Re: Checking For Changed Text
Quote:
Originally Posted by
sapator
In one textchange handler you can do handles textbox1.textchange,textbox2.textchange,textbox3.textchange
...etc
Further to this, you can have the IDE add them all to the Handles clause for you using the designer. Open the form in the designer and then select all the desired controls. Open the Properties window and click the Events button at the top. Double-click the desired event and, hey presto, the IDE generates a single event handler with all the selected controls in the Handles clause. After the fact, you can select another control and then select the exiting event handler from the drop-down for the desired event. This is how event handlers have been created in C# from the original VS.NET, but it was only added to VB in 2005.
Re: Checking For Changed Text
Yes but doing it from the designer is lame ("TRUE" metal sign here).
Ok i'm joking, thanks for the info, i guess some things still haunt me from my vs2003 days :)
Come to think of it, the PC i'm now still has vs2003 and i still use it occasionally