|
-
Apr 4th, 2008, 02:50 AM
#1
Thread Starter
New Member
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
-
Apr 4th, 2008, 03:03 AM
#2
Hyperactive Member
Re: Indexing of textboxes ???
-
Apr 4th, 2008, 03:14 AM
#3
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
-
Apr 4th, 2008, 04:38 AM
#4
Thread Starter
New Member
Re: Indexing of textboxes ???
Thanks a lot Stimbo.
Exactly what I was looking for.
Filip
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|