Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 4th, 2006, 02:19 PM
Authorized User
 
Join Date: Jul 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Combo box problem

I have a combo box with twelve elements in it, and i would like to know how to have one specific element selected as default. For example using the list control during the load event:

if list(i)="something" then list.selected(i)=true

but with the combo boxes i can't do this, because they don't have selected method :(

any suggestions should be appreciated


 
Old October 4th, 2006, 02:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there...

use the text property.. you have to set the text property to a text that exist in the combo. also don't do that in the load event of the form b/c combo boxes are render after the load and you will see that nothing is select.

take in mind that the text should be exactly as one of the text in the selection box (unless your combo is set to enter anything).

HTH

Gonzalo
 
Old October 4th, 2006, 05:32 PM
Authorized User
 
Join Date: Jul 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thx a lot that does it.:)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo box to display items from parent combo box Gini Visual Studio 2008 0 June 18th, 2008 12:30 AM
Combo box choice creating filtered combo box stevensj5 Access 11 September 13th, 2007 11:33 AM
Problem with Combo Box ru1 Access 1 October 20th, 2006 06:32 AM
Combo Box Problem munrrob Access 1 September 21st, 2006 10:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.