473,386 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

display the first item in a combobox

Hi everyone

I have 6 items "inside" the combobox.

I would like to display the first item (eg 2005) when load the form.
Another items in the combobox are 2004,2003,2002,2001 and 2000.

In VB, I only have to write combobox.listitem(0) in the form load and it
will show me the first item, but here in C# is different..

Can someone help me?
Cheers!
Claudi
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
1 14596
Claudia Fong wrote:
Hi everyone

I have 6 items "inside" the combobox.

I would like to display the first item (eg 2005) when load the form.
Another items in the combobox are 2004,2003,2002,2001 and 2000.

In VB, I only have to write combobox.listitem(0) in the form load and it
will show me the first item, but here in C# is different..

Can someone help me?

ComboBox.SelectedIndex = 0;
Cheers!
Claudi
*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Timo | last post by:
I am trying to use the DropDownList_SelectedIndexChanged event on a dropdown which is dynamically populated with different values at runtime, depending on what the user has been doing. The dropdown...
2
by: Nate | last post by:
I have used the feedback on this issue to remedy my comboboxes showing the first item on the list when a new record is added to the binding context --- Me.BindingContext(dsOrders,...
5
by: glenn | last post by:
Hi folks, If I want to select the first item in a DropDownList, I need to first select any item other than the first item and then next I select the first item which will then fire an event...
0
by: Ryan Liu | last post by:
In a listview, I found it is pretty nice I can type a letter or more letter quickly to select the NEXT item which begin with that letter(s). But seems the first row, even not high lighted, always...
5
by: Cindy H | last post by:
Hi I have a ddl that I have populated with a dataset. I have 2 items in the ddl. The first one is '3D' and the second one is 'Spot'. I have to select Spot - the second item in the ddl and then...
1
by: Justin | last post by:
Hi all, I have a bunch of drop-down lists that should each display an item (from a SQL Server lookup table) based on another piece of data from a separate table. For example; If Not...
1
by: polocar | last post by:
Hi, I'm using Visual C# 2005 (part of Visual Studio 2005 Professional Edition), and I have the following problem: I populate a ListView object with several items, and at the end of this process I...
0
by: uspazn | last post by:
Hello all, I am a newbie and this is my problem. I have a program that uses a simple access database. Seperate tables in the database fill several comboboxes. When the user selects an item in the...
1
by: dharmbhav | last post by:
Hi, I am using an AJAX AutoCompleteExtender to display a list of suburbs-postcodes after the user presses 3 keys in the given textbox. The problem is that on the page, I can't move my selection...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.