|
-
Mar 1st, 2004, 05:58 PM
#1
Thread Starter
Lively Member
Selecting combobox contents
Hello,
I have a newbie combobox question.
The combobox contains California's cities but I don't want to hardcode something like:
VB Code:
If cboState.Text = "Sacramento" = Then
'Do something with the selection
End If
Is there any other property I can use in a selection without hardcoding?
Any coding suggestions are welcomed!
Chris
Last edited by Trancedified; Mar 1st, 2004 at 06:05 PM.
-
Mar 2nd, 2004, 05:20 AM
#2
Sleep mode
I don't know what you mean by hardcoding but this maybe another way .
VB Code:
Dim indx As Integer = Me.ComboBox1.SelectedIndex
Select Case indx
Case 0
Case 1
Case 2
End Select
-
Mar 2nd, 2004, 11:58 AM
#3
Thread Starter
Lively Member
Pirate,
Sorry what I meant was for each city of California something is done differently maybe a few more checkboxes on the form being made available or something of that nature.
For every city I don't want to hardcode because that piece of code will be too long, plus there are 50 states, making the code even longer.
What I don't want to do is:
VB Code:
If cboState.SelectedItem = "Los Angeles" Then
CheckBox1.Visible = False
End If
Is there an alternative to keep the code smaller?
Thanks
Chris
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
|