Windows Forms Question

  • Thread starter Thread starter John Wright
  • Start date Start date
J

John Wright

Is there a way I can capture the event on the form and react to it. I have
some textboxes that I want to capture which textbox is firing the
textchanged event. I can tie all the textboxes to the one event using the
handles keyword and listing all the text boxes, but all I want is the
control that is firing, check if it is a textbox, get the key value and do
some processing. Basically I want a control array. How can I do this?

John Wright
 
John Wright said:
Is there a way I can capture the event on the form and react to it. I
have some textboxes that I want to capture which textbox is firing the
textchanged event. I can tie all the textboxes to the one event using the
handles keyword and listing all the text boxes, but all I want is the
control that is firing, check if it is a textbox, get the key value and do
some processing.

Inside the event handler:

\\\
Dim SourceControl As TextBox = DirectCast(sender, TextBox)
MsgBox(SourceControl.Name)
///
 
Back
Top