default choice of ComboBox

Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
Reply

Join Date: Dec 2008
Posts: 9
Reputation: SerogaM is an unknown quantity at this point 
Solved Threads: 0
SerogaM SerogaM is offline Offline
Newbie Poster

default choice of ComboBox

 
0
  #1
Dec 24th, 2008
Hi,I'm new in WinForms Application help me change my ComboBox to default state of one of Collections I have
Thanks Sergey
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: default choice of ComboBox

 
1
  #2
Dec 24th, 2008
Set the property SelectedIndex to the item's index you want it to be the default...
Say we want to show the 6th item
In form load handler add this piece of code
  1. comboBox1.SelectedIndex = 5;
Last edited by Ramy Mahrous; Dec 24th, 2008 at 4:17 pm.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: default choice of ComboBox

 
0
  #3
Dec 28th, 2008
Please SerogaM, mark this thread as solved if you question correctly answered.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC