Results 1 to 6 of 6

Thread: [RESOLVED] How do I make my checkedlistbox value change by selection of combox value?

Hybrid View

  1. #1
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: How do I make my checkedlistbox value change by selection of combox value?

    Quote Originally Posted by Aggierich View Post
    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

  2. #2

    Thread Starter
    Hyperactive Member simpleonline1234's Avatar
    Join Date
    Mar 2010
    Posts
    322

    Re: How do I make my checkedlistbox value change by selection of combox value?

    Hey thanks Paul and others....your solutions have saved the day...sorry for the delayed response....been coding like crazy to get this app up....eyes are burning so I took a break but any who...thanks guys you rock!
    Are you down with OOP?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width