473,410 Members | 1,857 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,410 software developers and data experts.

Combobox not diplaying properly!!

Eva
Hello,

I have a combobox on my form that will contain a list of
items when the combobox is clicked.

I have used the following code in the comboBox's click
event to add the items:

Private Sub CBoxDisCaraNames_Click(ByVal sender As Object,
ByVal e As System.EventArgs) Handles CBoxDisCaraNames.Click

If CBoxDisCaraNames.Items.Count = 0 Then
'load the caravan combobox with caravan names
Dim Cn As New SqlConnection("data
source=PARAGLAPTOP\VSdotNET;initial
catalog=CaravanDBLapSQLServ;integrated
security=SSPI;persist security info=False;workstation
id=PARAGLAPTOP;packet size=4096")
Dim cmd As New SqlCommand("SPSelCaraModels", Cn)
cmd.CommandType = CommandType.StoredProcedure

Try
Cn.Open()
Dim reader As SqlDataReader
reader = cmd.ExecuteReader()
While reader.Read
CBoxDisCaraNames.Items.Add
(reader.GetSqlString(0))
End While
Catch ex As Exception
MsgBox(ex.Message)
Finally
Cn.Close()
End Try
End If

End Sub
the problem i am having is that when the items are first
loaded into the combobox a full list is not displayed.
Onl;y a single item is shown!! However i can access the
other items by pressing on the 'up and down' arrows that
appear next to the single item.
When i click on the list a second time, the full list is
diplayed like a normal combobox!!

This strange behavious only seems to occur when the items
are first loaded.

does anyone know how i can stop this from happening??
Jul 21 '05 #1
0 1084

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

Similar topics

2
by: Phil | last post by:
My form uses a dataset containing two tables, a base table (Contact) and a lookup table (Insurer). My combobox is bound as follows: DataSource = datasetContact DisplayMember =...
0
by: Royse | last post by:
Hi I have a css drop down menu that for some reason the drop down doesn't stay on top of main menu items (in I.E) z index doesn't seem to be working all code is on the page at...
1
by: Georges Heinesch | last post by:
Hi. I have a text field (txtTX) and a combobox (cboCB). Both controls are on 2 different subforms (SF1 and SF2) belonging to the main form (MF). MF -+- SF1 --- txtTX +- SF2 --- cboCB txtTX...
7
by: Sam | last post by:
Hi, In this code my combobox is properly filled with all the records in my dataset. But when I want to set it to a value using selectedvalue, it just don't work as cboViewTable.SelectedValue...
0
by: Eva | last post by:
Hello, I have a combobox on my form that will contain a list of items when the combobox is clicked. I have used the following code in the comboBox's click event to add the items: Private...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
5
by: Don | last post by:
I have a project wherein I derive a combobox and create a custom Populate() method for it to fill it with objects of a custom class I also created in a second project that the combobox project...
0
by: Frnak McKenney | last post by:
Can I use a bound ComboBox for both browsing and editing? I'm working on a small, standalone database application using Visual C#.NET 2003 and an Access data file. In order to keep the number...
1
by: kimic | last post by:
Hello, i am using WPF combobox in my application. 1) I create and add a combobox to a visual container (usualy Grid) by runtime or it is defined in the XAML page 2) I assign combobox source to the...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.