|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ComboBox needs helpI created a combo box with some values: "First name" and "Last name". I add those values by using Data/Databinding/Items in the form. However, when I run the application, the "First name" is not appeared in the form. I have to click on the Combobox to get that value. What I want is that when I run the application, the "First name" value should be appeared. Could you please help Thank you In the generated code (Windows Form Designer generated code), I have: Me.ComboBox1.Items.AddRange(New Object() {"First name", "Last name"}) Me.ComboBox1.Location = New System.Drawing.Point(120, 16) Me.ComboBox1.Name = "ComboBox1" Me.ComboBox1.Size = New System.Drawing.Size(100, 23) Me.ComboBox1.TabIndex = 2
Show quote
Hide quote
"shoa" <s**@slingshot.co.nz> wrote in news:1112047555.794034@ftpsrv1: Try comboBox1.SelectedIndex = index> Hello all > I created a combo box with some values: "First name" and "Last name". > I add those values by using Data/Databinding/Items in the form. > However, when I run the application, the "First name" is not appeared > in the form. I have to click on the Combobox to get that value. What I > want is that when I run the application, the "First name" value should > be appeared. Could you please help > Thank you > > > In the generated code (Windows Form Designer generated code), I have: > > Me.ComboBox1.Items.AddRange(New Object() {"First name", "Last name"}) > Me.ComboBox1.Location = New System.Drawing.Point(120, 16) > > Me.ComboBox1.Name = "ComboBox1" > > Me.ComboBox1.Size = New System.Drawing.Size(100, 23) > > Me.ComboBox1.TabIndex = 2 > > > http://msdn.microsoft.com/library/default.asp?url=/library/en- us/cpref/html/frlrfsystemwindowsformscomboboxclassselectedindextopic.asp MP Shoa,
> I created a combo box with some values: "First name" and "Last name". I What do you mean with this sentence> add > those values by using Data/Databinding/Items in the form. > Me.ComboBox1.Items.AddRange(New Object() {"First name", "Last name"}) This set the first in your textbox to "First name" and the second item to "Last Name" (When there is no databinding) The rest of the instructions have not to do with the filling of the combobox, so you make me curious what you want to achieve? Cor *** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! "shoa" <s**@slingshot.co.nz> schrieb: Please correct your system's time settings. You are living in the future > Hello all ;-). -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> |
|||||||||||||||||||||||