Indexing of textboxes ???
Hi,
At last, I started using VB.NET, but I'm used to program in VB6.
In VB6 I indexed my textboxes, so I could use the same sub for every
textbox.lostfocus for example.
Now in VB.NET that is impossible.
Let's say I have 3 textboxes (TextBox1,TextBox2,TextBox3) but I would like to write a general lostfocus (for changing the backcolor) for all three of them. Is that possible ?
Thanks in advance
Re: Indexing of textboxes ???
Re: Indexing of textboxes ???
Is this what you are after?
vb Code:
Private Sub WhichTextBox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles TextBox1.LostFocus, Textbox2.lostfocus, textbox3.lostfocus
MessageBox.Show(DirectCast(sender, TextBox).Name) 'Display which one,
End Sub
Re: Indexing of textboxes ???
Thanks a lot Stimbo.
Exactly what I was looking for.
Filip