Results 1 to 9 of 9

Thread: How to show list while setting visible=true

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Posts
    252

    How to show list while setting visible=true

    Gurus,
    One more Question !

    How to clear Combobox's selection,
    it means... after loading application, combobox dosen't show any value unless selected. Once selected, combobox shows any value all the time.
    so how to clear combobox's selected value ??

    Thank you all ....
    Last edited by NANC; Aug 4th, 2004 at 05:51 PM.

  2. #2
    Junior Member
    Join Date
    Jul 2004
    Location
    Port Huron, Michigan
    Posts
    20
    ComboBox.SelectedIndex = -1

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Posts
    252

    How to show list while setting visible=true

    It worked great, thank you.

    I have one more issue.

    I want to set combobox visible=true on clike event.
    at the same time I want to show all list[value] of combobox.

    what should I do.

    Thank you.

  4. #4
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    this mate?
    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.       ComboBox1.SelectedIndex = -1
    3.       ComboBox1.Visible = False
    4.    End Sub
    5.  
    6.    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    7.       Dim s, s2 As String
    8.       For Each s In ComboBox1.Items
    9.          s2 &= s & Constants.vbCrLf
    10.       Next
    11.       MessageBox.Show(s2)
    12.       ComboBox1.Visible = True
    13.    End Sub
    if not, sorry.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Posts
    252
    I am sorry, I think, I didn't explain well.


    Normally, while we click on combobox, it will show the collection of items it contains. [combobox opens when we click on it]

    I want to show all collection of items [or open combobox] without clicking it.

    in form load event : combobox.visible=false

    in button click event: combobox.visible=true
    [combobox.open..... or something like that]
    so, what should be the command to open combobox.????

  6. #6
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    ah. hehe. sori. you mean, this?
    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.       ComboBox1.DroppedDown = True
    3.    End Sub

  7. #7
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843
    If this is to force the user to pick an item before they continue with the form, it may be best,
    at least easier, to pop up another form with all the items listed, say, in a listbox,
    when they choose one, it could close and set the corresponding item on the combo box
    on the first screen.
    Merry Christmas

  8. #8
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843
    Originally posted by brown monkey
    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.       ComboBox1.DroppedDown = True
    3.    End Sub
    Um, I mean, what he said.
    Merry Christmas

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Posts
    252
    I got it,
    thank you very much BROWN MONKEY.

    You helped me once again.

    Thanks a lot.

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