473,396 Members | 1,784 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.

combobox behaviour

Hi,
I create a combobox in the new event of a form. Fill datasource with dataset
and so on.
Works in so far that the items (combo.items.count) only show after the load
event. I found a workaround by setting the visible prop to true and
immediatly to false again (in the new sub).
Why is this happening and is there a better solution for it?
Thanx
FRank
Nov 20 '05 #1
6 1044
Hi Frank,

The combobox is a very nice control, however it has a lot of let's call it
unexpected behaviours.

To use a combobox with a datasource, the easiest way for that is to make a
global Boolean that you set to true in the end of the load event. In your
selectedindexchange event you can than set
\\\
If switch or whatever name you use is true then
///
When you want to show a empty textbox you have to set twice (you read that
well) also the selected index to -1 in that load event.

I hope this helps?

Cor

I create a combobox in the new event of a form. Fill datasource with dataset and so on.
Works in so far that the items (combo.items.count) only show after the load event. I found a workaround by setting the visible prop to true and
immediatly to false again (in the new sub).
Why is this happening and is there a better solution for it?
Thanx
FRank

Nov 20 '05 #2
Thanks for your reply Cor, but I don't get it.

You write: if switch is true then...

Then what?

And what load event do you mean, the form load?

Thanks
Frank

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:#X*************@tk2msftngp13.phx.gbl...
Hi Frank,

The combobox is a very nice control, however it has a lot of let's call it
unexpected behaviours.

To use a combobox with a datasource, the easiest way for that is to make a
global Boolean that you set to true in the end of the load event. In your
selectedindexchange event you can than set
\\\
If switch or whatever name you use is true then
///
When you want to show a empty textbox you have to set twice (you read that
well) also the selected index to -1 in that load event.

I hope this helps?

Cor

I create a combobox in the new event of a form. Fill datasource with

dataset
and so on.
Works in so far that the items (combo.items.count) only show after the

load
event. I found a workaround by setting the visible prop to true and
immediatly to false again (in the new sub).
Why is this happening and is there a better solution for it?
Thanx
FRank


Nov 20 '05 #3
Hi Frank,

Yes the form load,

The combobox is mostly processed from the index change event.

In that you can make something as
Private event index...........................
If AllLoadedSw then

' do your stuff

End if
End sub
Nov 20 '05 #4
When you say the new event, I suppost you mean the Sub New ?

Declare this a a class level object and instaniate it in On_Load

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Frank" <fr***@frank.com> wrote in message
news:cb**********@news1.tilbu1.nb.home.nl...
Hi,
I create a combobox in the new event of a form. Fill datasource with dataset and so on.
Works in so far that the items (combo.items.count) only show after the load event. I found a workaround by setting the visible prop to true and
immediatly to false again (in the new sub).
Why is this happening and is there a better solution for it?
Thanx
FRank

Nov 20 '05 #5
Cor,
I don't need an event. But I found something about cb's on the inet, thats
probably what u are refering to. But I am not sure that's my problem.
The cb is filled properly, but before the load event the items.count =0, in
the formloadevent it is x. So if I choose an item before the formload the
shown cbitem is wrong. If I choose an item in the formload the selecteditem
is set correctly.
So I moved the filling of the cb to the formload.
Still a strange behaviour, is it considered a bug by MS?
Frank

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:#v**************@TK2MSFTNGP10.phx.gbl...
Hi Frank,

Yes the form load,

The combobox is mostly processed from the index change event.

In that you can make something as
Private event index...........................
If AllLoadedSw then

' do your stuff

End if
End sub

Nov 20 '05 #6
> Still a strange behaviour, is it considered a bug by MS?
Frank


I wrote it as this Frank.
The combobox is a very nice control, however it has a lot of let's call it

unexpected behaviours

That means that when it it loading a datasource the most strange things can
happen. It fires events suddenly, the index change fires two times by
instance. That is true that it change when it is loading a datasource,
however you would expect that that would be suppressed, but it is not.

Another very known thing is that when you want to set the index initially
to -1 (empty) you have to do that twice.

Cor

Nov 20 '05 #7

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

Similar topics

0
by: Gary Boulter | last post by:
hi, I have an object populated from the database, The object has three properties, the ID, a description, and a State If I bind the object as a collection to a combo comboBox.DataSourse =...
2
by: Peter Proost | last post by:
Hi group could someone please confirm this behavior? Place a combobox on a form an add some items to it, then in the combobox_keyup event place the following code: combobox1.droppeddown = true...
5
by: Claudio Di Flumeri | last post by:
Hi all, Iive found this bug int the VB combobox and I'd like to know if there is a way to solve it... Put a combobox in a form, and fill it with these 3 items: - athens - berlin - chicago ...
6
by: Juan Pedro Gonzalez | last post by:
I wanted to add a Combobox to a toolbar... Kind of the look you get on VisualStudio's toolbar. I've been able to find some VB 6 samples, but the placeholder option is no longer available for...
6
by: Sakharam Phapale | last post by:
Hi All, How to fill one ComboBox from other ComboBox control? 1) Only setting the reference does the trick but doesn't show items in control. If you see in immediate window, it shows...
5
by: Brian | last post by:
I've setup a custom combobox control that allows a multikey selections. This lets the user enter key presses and the combo scrolls to the matching selection. I run into a bug when the user opens...
8
by: Gregory A Greenman | last post by:
I have a minor, but somewhat frustrating, problem. In a program I'm working on, I've got a tabcontrol that contains several other controls, a few of which are comboboxes. In the IDE, one of the...
5
by: Peter M. | last post by:
I'm struggling with combobox databinding with something I consider a bug... I'm binding my combobox to an array of structs. The struct exposes two public properties, ID and Name, to be used as...
2
by: mfleet1973 | last post by:
Hello (again), Within my datagrid I add a control to the datagridtextboxcolumn when the underlying textbox receives focus as follows: Combobox1.Size = New...
3
by: Simon van Beek | last post by:
Dear reader, What can be wrong in my ComboBox, the property "Auto Expand" is set to Yes, but by typing in the ComboBox it doesn't expand. Is this because the source of the ComboBox is a...
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: 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
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?
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:
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
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
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,...

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.