Home All Groups Group Topic Archive Search About

Windows Forms Question

Author
19 Apr 2006 8:09 PM
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

Author
19 Apr 2006 8:12 PM
Herfried K. Wagner [MVP]
"John Wright" <riley_wri***@notmail.com> schrieb:
> 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)
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>