3 Replies - 4787 Views - Last Post: 16 May 2012 - 06:18 PM Rate Topic: -----

#1 appzone   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 07-March 12

[ASK]Control Resize VS Screen Resolution

Posted 26 March 2012 - 10:50 AM

hi all..
i want to ask about screen resolution and control resize

how can i make my control, like button, textbox, etc resize automatically within any screen resolution?

have you guy ever hear about active resize from vbgold.com?


i want my vb net application look like that

so if we use ANY resolution, the application we create will not messed

it can strecth

i already try dock, anchor, panel, etc, but it cannot work.

are you guy have clue or answer for this?

thanx for the attention

Is This A Good Question/Topic? 0
  • +

Replies To: [ASK]Control Resize VS Screen Resolution

#2 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6534
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: [ASK]Control Resize VS Screen Resolution

Posted 26 March 2012 - 12:36 PM

There is no 'automatic' about resizing your form to your resolution.

You can react to the Form.Resize event, and manually loop through all your controls to resize and relocate them.

If you take a little bit of thought about your resizing and repositioning it can all happen dynamically.

The first control (lets say a button) is resized to 10% of the form.ClientArea.Width.
Then the other 20 buttons are sized to be the same as the first.
Then you position your second groupbox to an offset from the first groupbox
groupbox2.Location = new point (groupbox1.Bounds.Right + 5, groupbox.Location.Y);

And so on. There is nothing fancy about it, just brute force of starting at the upper-left corner control and sliding everything over and down by a percentage of the overall form size.

This is one of the reasons I'm making the transition from WinForms to WPF where this is handled REALLY REALLY nice.

Was This Post Helpful? 1
  • +
  • -

#3 ricardosms   User is offline

  • D.I.C Regular
  • member icon

Reputation: 74
  • View blog
  • Posts: 301
  • Joined: 02-April 10

Re: [ASK]Control Resize VS Screen Resolution

Posted 16 May 2012 - 04:03 PM

This is an older post, but for others to find a different approach, please take a look here:
Was This Post Helpful? 0
  • +
  • -

#4 polens   User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 155
  • Joined: 09-November 09

Re: [ASK]Control Resize VS Screen Resolution

Posted 16 May 2012 - 06:18 PM

or just set the ANCHOR property of the control...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1