473,385 Members | 1,192 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,385 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 1082

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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.