Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi everyone!
 
How can I change the size of the dropdown of a combobox to be dynamic in size from fixed width? I cannot find an event or a property that allows me to flip a switch. Am I missing something?
 
Thanks!
Posted 17-Jan-13 8:56am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Of course you have such event:
http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.resize.aspx[^].
 
But you don't need to use it. Instead, you should better use fluid layout of the whole form, using a hierarchy nested panels and docking (see System.Windows.Forms.Control.Dock), with System.Windows.Forms.Control.Padding. Please see my past answers:
Zom Out malfunctions when Screen resolution changes[^],
how to dock button so that it can adjust with the form[^] (see a tiny code sample here).
 
—SA
  Permalink  
Comments
Espen Harlinn at 17-Jan-13 16:26pm
   
5'ed!
Sergey Alexandrovich Kryukov at 17-Jan-13 16:42pm
   
Thank you, Espen. —SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Yes you can change the width of the dropdown porting using the DropDownWidth property of ComboBox
 
Check this ComboBox.DropDownWidth Property[^]
 
but you need to set the new size of your choice. it wont expand/shrink automatically
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Guruprasad.K.Basavaraju 460
1 Sergey Alexandrovich Kryukov 336
2 Shai Vashdi 294
3 OriginalGriff 280
4 Abhinav S 160
0 Sergey Alexandrovich Kryukov 9,185
1 OriginalGriff 5,315
2 Peter Leow 4,040
3 Maciej Los 3,535
4 Abhinav S 3,308


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid