
Question:
I'm trying to resize a combobox in a visual studio 2008.
Wwhen I try this in c# the combobox height stays locked at the default size. The only way to change it is to write code that assigns new height values at runtime.
<img alt="See example" class="b-lazy" data-src="https://i.stack.imgur.com/9OkLC.jpg" data-original="https://i.stack.imgur.com/9OkLC.jpg" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />
Whenever I enter a value in the height field the value changes back to 21.
This problem only occurs with comboboxes. Resizing textboxes and buttons works fine.
Any idea what I am doing wrong here?
Answer1:I had similar problem with ComboBox in VS2010. I solved it by editing its DrawMode to <strong>OwnerDrawFixed</strong> and then changing <strong>ItemHeight</strong> property. Hope it will work for you also. You can read more about it here: <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.drawmode.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.forms.drawmode.aspx</a>
Answer2:Simply Change the Font Size
of the ComboBox in the property window that will automatically increase the Height of your ComboBox.