|
-
Mar 13th, 2004, 12:39 AM
#1
Thread Starter
New Member
Help with combo box
I have this code so if I select something from the combo box, there is a text box next to it, which will show the explanation of the selection, can someone take a look at this and see if there is a way to make this happen:
VB code:
Private Sub cbSLAType_Change()
If cbSLAType = "PC Replacement" Then
txtTypeDetail.Visible = True
txtTypeDetail.Text = "PC Replacement"
ElseIf cbSLAType = "Password Reset" Then
txtTypeDetail.Visible = True
txtTypeDetail.Text = "Password Reset"
ElseIf cbSLAType = "3D ID set up" Then
txtTypeDetail.Visible = True
txtTypeDetail.Text = "3D Id Set Up"
ElseIf cbSLADetail = "Phone Moves" Then
txtTypeDetail.Visible = True
txtTypeDetail.Text = "Phone Moves"
ElseIf cbSLAType = "Workstation Moves" Then
txtTypeDetail.Visible = True
txtTypeDetail.Text = "Workstation Moves"
ElseIf cbSLAType = "LAN Printer Moves" Then
txtTypeDetail.Visible = True
txtTypeDetail.Text = "LAN Printer Moves"
Else
txtTypeDetail.Visible = False
End If
End Sub
maybe there is a better way to do this, the text box is going to be invisible, but when they make the selection, it'l show the explanation.
Thank you for your help.
-
Mar 13th, 2004, 01:07 AM
#2
Does it show the explanation when you CLICK it? Or when you move the mouse over it?
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Mar 13th, 2004, 01:31 AM
#3
Thread Starter
New Member
-
Mar 13th, 2004, 06:06 AM
#4
You need to put this code in the Private Sub cbSLAType_Click(), Click event, not Change event. You would think logically that it goes in the Change event because the text is changing. But VB doesn't think that logically. I just changed it to the Click event and it works fine.
-
Mar 13th, 2004, 08:21 AM
#5
Thread Starter
New Member
-
Mar 13th, 2004, 05:22 PM
#6
Originally posted by Adnane
Yes it worked, Thank you
When you have the answer, please edit the Subject of the first post and add the word resolved.
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
|