We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,913 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

ComboBox Grow / Shrink

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

3
Contributors
4
Replies
9 Hours
Discussion Span
3 Months Ago
Last Updated
6
Views
IsaacMessi10
Light Poster
43 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 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

mshauny
Junior Poster in Training
68 posts since Jan 2010
Reputation Points: 35
Solved Threads: 7
Skill Endorsements: 0

Thanks a lot.

IsaacMessi10
Light Poster
43 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 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.

Begginnerdev
Practically a Posting Shark
861 posts since Apr 2010
Reputation Points: 184
Solved Threads: 142
Skill Endorsements: 8

During runtime when user maximses

IsaacMessi10
Light Poster
43 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0741 seconds using 2.67MB