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

Bug In Combobox / listbox - SelectedIndex on form open!!

Hi All,

I've come across something which I think is a bug in the windows forms
combobox and listboxes.

I have a simple form which retrieves a datatable, and then set the
datasource of a listbox to the datatable.
I then set the displaymember / valuemember to the appropriate fields of the
datatable.
Then I set the selectedindex to -1

On a form opened with it's MDIParent set to an MDI container (a form in my
case), the first entry in the list is selected when the form is opened
(SelectedIndex = 0).
If the same form is opened without an MDI parent, the listbox displays as
you would expect, without anything selected and it's (SelectedIndex = -1).

Anyone else found this, and got a workaround?
I've seen some posts regarding the SelectedIndex changing on a tab, but
nothing about an MDIparent issue?

Any help or an alternative method of filling a combo / lisbox with a display
/ valuemember would be appreaciated.

Thanks

Alex Stevens
Nov 20 '05 #1
1 1180
Cor
Hi Alex,

I tried it and had the same unwanted result as you, while when I replace
everything to the visible change event it works both the same.

Cor
Nov 20 '05 #2

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

Similar topics

2
by: aaa | last post by:
Hello to all, In an application under VB6, I need to fill some ComboBoxes with data. However, I don't know in advance how many ComboBoxes I will need. I could of course create many (maybe 15 or...
2
by: Ron Rohrssen | last post by:
I'm trying to use the ErrorProvider in order to validate my form. This is working well except that in the event of a failure on my modal dialog, I'd like to keep the dialog open. I open the...
2
by: HB | last post by:
Guys, PLS tell my why the ListBox SelectedIndex is always -1?, I am sure selection was made. Thanks HB
5
by: Eric A. Johnson | last post by:
Hi Everyone, I am at my wit's end here. I have a combobox (combyQueryTitle) that I need to use in order to select a query for my database project. Therefore, I am using the...
2
by: Kaur | last post by:
Hi, I have developed an application in MS Access 2000 where I am trying to highlight a record in the list box in form 2 based on the record selected in form 1. The form 1 lists all the Document...
2
by: morangriffin | last post by:
Hi, New at VB6, I would like to know how to have a form open upon running the VB6 and layer to the front of the forms, Thanks Greg
1
by: Captdreamer | last post by:
Hi there, As it will be very apparent in a moment, I am very new to Access and learning on the fly. (Much fun, but frustrating at the same time) I currently am trying to get a Combo Box that I...
3
by: beemomo | last post by:
I have two tables - 'Client' and 'Company', and two forms, 'Client' and 'Company', the relationship between two table is 1:many where a company can have one or more client but each of the client...
1
by: Eddie Z | last post by:
I'm trying to make a dialog box pop up and ask the User for their name when they open a particular form. I then want to set the default value of a text box called "EnteredBy" to their name. 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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.