CComboBox won't dropdown choices

My app has several dialogs.

On one of them that has a lot of controls none of the combobox dropdown menus work. When in the Visual studio IDE (Visual studio vs. 2005) clicking on the little dropdown arrow typically allows you to enlarge the dropdown region and this is quite long and similar comboboxes with same attribute in other windows have similar dropdown region length. On the dialog where it doesn't work clicking on the dropdown only show an additional line under the control, as if the size was set to something ridiculiously small. Is ther a way to fix this programatically by setting the dropdown area to display a few items?

Thanks
leogiAsked:
Who is Participating?
 
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantCommented:
Maximum number of controls - I don't know of a programming limit in Visual Studio but I don't see why it should give behaviour as you describe either should there one.  (I would expect the control to either be there or not at all - not that it is there but behaves oddly).

However the question of why do you have so many controls needs to be asked.  As a user I would be offput by a too complex dialog and as a coder the maintenance of a dialog like that is overly complex.  I admit I have not seen the dialog but I suspect my last statement to be correct.

Would you not be better with a tabbed dialog layout? (property sheet + property pages)
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
In the resource editor select the combo box.  Now drag the vertical size down - this WILL fix it.

You are in reality showing the drop down list part (only show an additional line under the control) it is just only a couple of pixels high
0
 
leogiAuthor Commented:
No this isn't it. The vertical section has been been elongated and further resizing won't do anything. I know exactly what you're saying, I am NOT talking about the edit section of the combobox but indeed the vertical section.
The dialog has a lot of controls, and the application was first developed using Visusal studio vs. 6 and them migrated to Visual studio 2005.
There is an attribute in MFC CCombobox that I believe control that size. Just can't find what it is.
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
AndyAinscowFreelance programmer / ConsultantCommented:
The behaviour you describe is EXACTLY that when the vertical height of the LIST portion is not set.  I am not talking about the edit portion of the combo.



0012.jpg
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Pressed return too soon

0013.jpg
0014.jpg
0
 
leogiAuthor Commented:
Well

I do appreciate your effort in helping here.

Unfortunately even though the behavior I describe is also the same behavior one would see when the LIST portion size is not set, this is not the problem.

In other words we have two different problems exhibiting the same behavior: I know 99% of the time people who do see this behavior are able to fix it using your recommended solution, However this is not the case this time.

I really appreciate you taking the time to help though

Thanks again
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Hmm.
Are you modifying the size/position of the combo in code?  If yes then check the height you set
0
 
leogiAuthor Commented:
o but i'd like to do just that, i.e changethat size programatically
0
 
DanRollinsCommented:
It needs to be mentioned:  
The dropdown list will be very short if thee are few items in the list
You can add data to the list and then check its behavior all in the IDE Resource Editor.  In Properties of the combo, set the Data element to 1;2;3;4;5;6;7;8  Then press Ctrl+T to test the dialog (then drop down the combobox list)
About the only other thing it could be is that the bottom of the list is hidden by some other control.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
>>o but i'd like to do just that, i.e changethat size programatically

MoveWindow or SetWindowPos are used to change location and size of windows.  (The vertical size as I mentioned initially is the height of the complete control = edit + list)
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
A quick hack.
In resource editor change the ID of this dialog.
Add a new dialog.
Remove the default controls on it, size it to the size of the problem dialog - modify any other settings to match.
Change the ID to that of the problem dialog (original value).
Copy and paste all controls.
Build all - does it now work?

0
 
leogiAuthor Commented:
I will try

I have over 200 controls but I'll let you know
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
>>I have over 200 controls but I'll let you know

Select all / copy / paste

The whole should take only a minute or so, then rebuild all.
0
 
leogiAuthor Commented:
About half of those combo boxes work now

It seems that those that don't work are those that have other controls over them or nearby. Those controls are not visible unless the user clicks on a button to replace the control on the screen

So maybe the event handler can't display the list because it thinks the other control is displayed when it's not.

It may be that to make it work the combo boxes should be the last inserted using studio IDE.
0
 
leogiAuthor Commented:

actually I added a combo box that is nowhere other control and that one won't work either

There must be some maximum number of controls that can be added using visual studio. In VC98, I could not add new controls in that window, in visual studio 2005 I can but I am running into these problems.
0
 
leogiAuthor Commented:
yeah I hear you.

The dialog display is dynamically driven but the user, and for a programming point of view extremely complex. However making it tab driven should probably happen but would take more time and is beyond the current difficulty.

You would expect MFC to work or not but the odd behavior is what I seem to have to deal with nonetheless.
0
 
DanRollinsCommented:
If you have over 200 controls on a dialogbox, you can expect strange behavior, but it is not a failing of MFC or Windows.   It is an issue of complexity.  With each new element, you create more ways for interaction to go awry.
0
 
leogiAuthor Commented:
Question is dropped because there hasn't been a single reason for these dropdown to stop working and they may have to do with the number of controls that have been added overtime. THe dialog will be rebuilt using a tab control which will alleviate the problem
0
All Courses

From novice to tech pro — start learning today.