1,105,450 Community Members

ComboBox Grow / Shrink

Member Avatar
IsaacMessi10
Junior Poster in Training
83 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 6 [?]
 
0
 

I want to make a combobox that will grow or shrink according to the screen size any help?

Member Avatar
mshauny
Junior Poster in Training
69 posts since Jan 2010
Reputation Points: 25 [?]
Q&As Helped to Solve: 7 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi Isaac, you can grow or shrink any .NET control by setting it's hight or width to whichever size using the [Control].Hight and [Control].Width....

Normally, I use the parent control of my control as a base for my resizing.
i.e If you had an outter control which uses docking and you had set your resize mode to Font (default) or DPI (screen resolution) then you easily subcribe to the Resize event then re-compute your new size as e.g Control.Width = ParentControl.Width-[Prefered padding size].

Hope you find this useful

Member Avatar
IsaacMessi10
Junior Poster in Training
83 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 6 [?]
 
0
 

Thanks a lot.

Member Avatar
Begginnerdev
Veteran Poster
1,142 posts since Apr 2010
Reputation Points: 251 [?]
Q&As Helped to Solve: 191 [?]
Skill Endorsements: 15 [?]
 
0
 

The easier solution would be to set the control's anchors in the desinger.

This will cut down on code.

Unles, of course, you are creating these controls on runtime.

Member Avatar
IsaacMessi10
Junior Poster in Training
83 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 6 [?]
 
0
 

During runtime when user maximses

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article