|
-
Nov 3rd, 2011, 04:49 PM
#5
Re: How do I make my checkedlistbox value change by selection of combox value?
 Originally Posted by Aggierich
I had this same problem a lil while back when i was tryin to change listbox based on combobox.text value. Here's how I worked around it:
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListBox1.Visible = False
ListBox2.Visible = False
ListBox3.Visible = False
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
' Display ListBox1 When ComboBox1.Text is set to "Resturants"
If ComboBox1.Text = "Resturants" Then
ListBox1.Visible = True
ListBox2.Visible = False
ListBox3.Visible = False
End If
' Display ListBox2 When ComboBox1.Text is set to "Stores"
If ComboBox1.Text = "Stores" Then
ListBox1.Visible = False
ListBox2.Visible = True
ListBox3.Visible = False
End If
' Display ListBox3 When ComboBox1.Text is set to "Gas Stations"
If ComboBox1.Text = "Gas Stations" Then
ListBox1.Visible = False
ListBox2.Visible = False
ListBox3.Visible = True
End If
End Sub
End Class
i wouldn't recommend that. it works but it's an unnecessary drain on resources
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
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
|