943,844 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 7440
  • VB.NET RSS
You are currently viewing page 1 of this multi-page discussion thread
Jul 25th, 2007
0

Combo Box

Expand Post »
Hello

I'm writing my first ever VB program. I'm using 2 combo boxes to allow the user to select 2 different pieces of information. Is there any way that I can make my program automaticaly open the first combo box up at startup so the user can easily see what they should be doing. At the moment at startup both combo boxes look like empty text boxes until the user clicks on one of them and then the box opens up. I would like to remove the need to click on the first box at startup.

Thanks you you help

Simon
Similar Threads
Reputation Points: 34
Solved Threads: 0
Light Poster
blondie.simon is offline Offline
27 posts
since Jul 2007
Jul 25th, 2007
0

Re: Combo Box

you could use a listbox instead.
Reputation Points: 84
Solved Threads: 58
Posting Pro in Training
waynespangler is offline Offline
461 posts
since Dec 2002
Jul 26th, 2007
0

Re: Combo Box

As suggested a list box would be a better option .
or
set the listindex property of the combobox to 0 (zero) so the first item in the list becomes the default choice even if user does not select anything.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Jul 26th, 2007
0

Re: Combo Box

you could use a listbox instead.

year i tried that but I prefer the way the Combo box looks and works to the List Box.
Reputation Points: 34
Solved Threads: 0
Light Poster
blondie.simon is offline Offline
27 posts
since Jul 2007
Jul 26th, 2007
0

Re: Combo Box

what bout setting the listindex to zero.
Last edited by debasisdas; Jul 26th, 2007 at 4:01 am.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Jul 26th, 2007
0

Re: Combo Box

Click to Expand / Collapse  Quote originally posted by debasisdas ...
what bout setting the listindex to zero.

That works but ut would be nice to be able to have the list box pulled down so that it draws the attention of the user to the box so they know that they need to select an item from the list.
Reputation Points: 34
Solved Threads: 0
Light Poster
blondie.simon is offline Offline
27 posts
since Jul 2007
Jul 26th, 2007
1

Re: Combo Box

Set item 0 to "Please select an item" and the listindex to 0.
Reputation Points: 84
Solved Threads: 58
Posting Pro in Training
waynespangler is offline Offline
461 posts
since Dec 2002
Jul 26th, 2007
0

Re: Combo Box

Set item 0 to "Please select an item" and the listindex to 0.

Great Idea :-) Thanks

Simon
Reputation Points: 34
Solved Threads: 0
Light Poster
blondie.simon is offline Offline
27 posts
since Jul 2007
Jul 29th, 2007
0

Re: Combo Box

Hi,

Wrie this code in Got focus event of combo box:

PrivateSub ComboBox1_GotFocus(ByVal sender AsObject, ByVal e As System.EventArgs) Handles ComboBox1.GotFocus
SendKeys.Send("%{down}")
End Sub

This will open up the drop down list

Regards
Veena
Last edited by QVeen72; Jul 29th, 2007 at 9:22 am.
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Jul 29th, 2007
0

Re: Combo Box

Click to Expand / Collapse  Quote originally posted by QVeen72 ...
Hi,

Wrie this code in Got focus event of combo box:

PrivateSub ComboBox1_GotFocus(ByVal sender AsObject, ByVal e As System.EventArgs) Handles ComboBox1.GotFocus
SendKeys.Send("%{down}")
End Sub

This will open up the drop down list

Regards
Veena
sending %{DOWN} which I think is sending Alt + the down arrow key does not seem to do anything. Lucky all the items in my selection box all start with an open bracket so by sending that it opens up the box for me. I can see why %{DOWN} should work but I cant get it to work
Reputation Points: 34
Solved Threads: 0
Light Poster
blondie.simon is offline Offline
27 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Automatic Copy to Notepad.
Next Thread in VB.NET Forum Timeline: Crystal Report





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC