[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

ComboBox not showing items in dropdown

John M

1/12/2005 8:47:00 PM

Has anyone experienced a problem where the items in the dropdown area of a
combobox do not appear? I can press the down arrow on the keyboard when the
control has focus and the proper text will display. I can even open the
dropdown, select any item (that is not drawn) and the proper text is
displayed in text area. I can't explain it. In fact in one and only one
case the items were shown.
4 Answers

Jacques

1/18/2005 4:15:00 AM

0

I hate to see a sit question sitting unnoticed for days like that, so:
Yes, many have experienced it. If you have a combobox with DropDownList
style, populate it with a number of items, and don't want a blank
initial selection, you need to explicitly set the SelectedIndex or
SelectedItem property of the combobox. As our good friends in Redmond,
WA say: This behavior is by design.
HTH,
Jacques

John M

1/18/2005 10:43:00 AM

0

That part I know about and have had to always remember that whenever I coded
a combo box. But my problem is the dropdown list itself is not showing the
items. There are items there because the scroll bar show a range of items.
My entire list just draw blank lines. If I drop down the list and select one
of these blank lines, the correct text is actually displayed in the combo box
area.

"Jacques" wrote:

> I hate to see a sit question sitting unnoticed for days like that, so:
> Yes, many have experienced it. If you have a combobox with DropDownList
> style, populate it with a number of items, and don't want a blank
> initial selection, you need to explicitly set the SelectedIndex or
> SelectedItem property of the combobox. As our good friends in Redmond,
> WA say: This behavior is by design.
> HTH,
> Jacques
>
>

Jacques

1/18/2005 6:40:00 PM

0

Oh, I see. If the empty dropdownlist sometimes happens and sometimes
doesn't happen for the same control, check the (all too numerous)
threads here regarding controls not repainting/updating themselves.
(Also, if you use Visual Studio, check if it only happens in IDE debug
mode.) If the empty dropdown list always happens for a specific
control, look at your items (the functionality for displaying dropdown
list members and displaying selected item are slightly different, so
differences may occur) - do you e.g. need to set the DisplayMember
property?

Adam Edell via DotNetMonster.com

1/21/2005 6:10:00 AM

0

I am having this same problem. I tested the program on more than one computer.

The dropdown has values shown when run on one of the computers, and has no values shown on 2 computers. They all have .NET 1.1. I also found another site that discusses this problem with no fix.

Does anyone know what is wrong?

The microsoft sample "ComboBoxCtl.sln" also shows the same problem.

--
Message posted via http://www.dotnetm...