views:

46

answers:

2

In a Windows Form Application, I have a ComboBox1 which gets initialized in InitializeComponent() function. I add the values into it in a different function.

snippet:

    public form1()
    {
        InitializeComponent();
        addDataToDropDowns();
    }

The problem I have is that, the rows loaded into the ComboBox1 have many characters(/length) and are not to be seen completely width wise.

Is it possible to have a horizontal scrollbar built into the ComboBox1 so that I can see the hidden part of the row too...??

Any ideas/inputs will be appreciated!

Thanks, Ivar

+3  A: 

There is actually a DropDownWidth property that controls how wide the drop down area is. This way you can have a narrow control that doesn't take up too much space on the form, but a larger drop down area that could extend over as much of the screen as you want.

Clyde
I want a specific sized drop down area, which does not take up a lot of screen space and for longer rows, displays a horizontal scrollbar
topgun_ivard
+1  A: 

http://www.codeproject.com/KB/combobox/ComboBoxAutoWidth.aspx

That has code sample that shows how to capture the event and widen the box.

OR, you could have it as a seperate function you manually call, like this: http://weblogs.asp.net/eporter/archive/2004/09/27/234773.aspx

Caladain