|
-
Aug 4th, 2004, 03:54 PM
#1
Thread Starter
Addicted Member
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.
-
Aug 4th, 2004, 04:28 PM
#2
Junior Member
ComboBox.SelectedIndex = -1
-
Aug 4th, 2004, 05:40 PM
#3
Thread Starter
Addicted Member
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.
-
Aug 4th, 2004, 08:54 PM
#4
Fanatic Member
this mate?
VB Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.SelectedIndex = -1
ComboBox1.Visible = False
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim s, s2 As String
For Each s In ComboBox1.Items
s2 &= s & Constants.vbCrLf
Next
MessageBox.Show(s2)
ComboBox1.Visible = True
End Sub
if not, sorry.
-
Aug 5th, 2004, 07:43 AM
#5
Thread Starter
Addicted Member
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.????
-
Aug 5th, 2004, 07:49 AM
#6
Fanatic Member
ah. hehe. sori. you mean, this?
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ComboBox1.DroppedDown = True
End Sub
-
Aug 5th, 2004, 07:53 AM
#7
Fanatic Member
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.
-
Aug 5th, 2004, 07:57 AM
#8
Fanatic Member
Originally posted by brown monkey
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ComboBox1.DroppedDown = True
End Sub
Um, I mean, what he said.
-
Aug 6th, 2004, 03:55 PM
#9
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|