Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Controls resize depending on the monitor size

Posted on 2016-10-05
7
Medium Priority
?
29 Views
Last Modified: 2016-10-11
Hello,

Iam using vb.net 2015.  Is there any way that I can resize the controls on the form and the resize the  form  depending on the monitor size.

Cheers
0
Comment
Question by:RIAS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 41830315
I normally set an anchor to the controls so they'll grow automatically.

You can use the screen class to determine the resolution of the screen:
https://msdn.microsoft.com/en-us/library/system.windows.forms.screen.aspx
 Dim screenWidth as Integer = Screen.PrimaryScreen.Bounds.Width
 Dim screenHeight as Integer = Screen.PrimaryScreen.Bounds.Height

Open in new window


You can then set the form's height and width to whatever you like.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41830400
I also use the Anchor property which I sometimes combine with Layout containers: http://emoreau.com/Entries/Articles/2010/01/The-Table-and-Flow-Layout-container-controls.aspx
0
 

Author Comment

by:RIAS
ID: 41831874
Thanks,
But the controls in tabpage are not resizing.
Any suggestions are appreciated.

Cheers
0
Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41831885
>>But the controls in tabpage are not resizing.

I have forms with tab pages and they are resizing so the problem is definitely not there. But since we don't wee how you set your stuff, we can't fully help you.

One blind guess: have you set the Anchor property for your controls inside the tabpages?
0
 

Author Comment

by:RIAS
ID: 41831892
Yes,
Tried Anchor but they resize and they stick to each other.May be I am doing something terrible wrong
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 41831912
how do you anchor them?

in a traditional application, you often have textboxes at the top and a grid at the bottom. the top controls are usually anchor to left, top  and right (so they stay at the same position but enlarge the width if possible) while the grid at the bottom could be anchor on all 4 sides to use the remaining space.

maybe you would be better with a table flow layout as shown in my article.
1
 

Author Comment

by:RIAS
ID: 41834048
Will try Eric!
0

Featured Post

A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question