Hi,
First of all I want to say thank you and my sincere gratitude this community, for monumental help and support you all are providing to the Developer/Engineer/Scientist communities across the Globe.
I am facing a huge challenge that involve a Textbox Text Changed event. So here you go.
I have a WinForms application that is running on Windows 10 environment. Multiples copy on the same form running at the same time on different Windows Console. At least minimum two forms can run at any time and maximum fifteen forms.
A person can select a specific sailboat lets say its SailBoatA on a console and select a button "Details", which open the SailBoatDetails form. This provides details about the sailboatA.
Another console someone could select another sailboat - SailBoatB and select details button, which open for SailBoatB - SailBoatDetails form.
SailBoatDetails form has following two text boxes:
**Destination Distance:
Arriving Port:****
On SailBoatDetails form for SailBoatA, an user could enter value 1100 in "Destination Distance" text box.
Then user will select an Apply button on the form and this value will be saved on a table. The enter value still displayed on the text box.
However on another console SailBoatB "Destination Distance" text box displayed the same value. Which should not.
I debugged and observed that in another console for SailBoatB
Private Sub txtDestinationDistance_TextChanged(sender As Object, e As EventArgs) Handles txtDestinationDistance.TextChanged
sub gets activated.
Sender object has the 1100.
How I can stop textbox change events after a user select "Apply" button for "SailBoatA"?
So I can prevent this event to go any other console?
Here is the code for the text box
Private Sub txtDestinationDistance_TextChanged(sender As Object, e As EventArgs) Handles txtDestinationDistance.TextChanged
Dim thisBoat As SpecialBoatA = AllBoats.HookAnyBoat
If thisBoat IsNot Nothing Then
thisBoat.distance = txtDestinationDistance.Text
...
...
Else
txtDestinationDistance.Text = ""
End If
End Sub