943,890 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 3156
  • C# RSS
Dec 24th, 2008
0

default choice of ComboBox

Expand Post »
Hi,I'm new in WinForms Application help me change my ComboBox to default state of one of Collections I have
Thanks Sergey
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SerogaM is offline Offline
16 posts
since Dec 2008
Dec 24th, 2008
1

Re: default choice of ComboBox

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
c# Syntax (Toggle Plain Text)
  1. comboBox1.SelectedIndex = 5;
Last edited by Ramy Mahrous; Dec 24th, 2008 at 4:17 pm.
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006
Dec 28th, 2008
0

Re: default choice of ComboBox

Please SerogaM, mark this thread as solved if you question correctly answered.
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

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 C# Forum Timeline: Timer Countdown
Next Thread in C# Forum Timeline: Adding picture like background WinForm





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


Follow us on Twitter


© 2011 DaniWeb® LLC