-
Mar 24th, 2014, 07:01 AM
#1
Thread Starter
Hyperactive Member
Form control to readjust size/position
Hi,
is there a way to automatically adjust the form controls sizes and positions if screen resolutions changes ?
-
Mar 24th, 2014, 07:45 AM
#2
Re: Form control to readjust size/position
To some extent... that's what the Anchor and Docking properties are for... but it also depends on what you mean by "position" ... TableLayoutPanel or a FlowLayoutPanel might be what you want in those cases... so some combination of those 4 items should be able to accomplish a considerable amount resizing and rearranging based on screen size - actually, it more dependent on the form size, which should be impacted by screen resolution.
-tg
-
Mar 24th, 2014, 08:09 PM
#3
Re: Form control to readjust size/position
Changing control sizes if the parent size changes is one thing but why would you do it if the resolution changes? If I change my resolution it is because I want either more or less on my screen. If my applications then decide that they're going to change their size then that defeats the purpose of changing the resolution in the first place. Other than in exceptional circumstances, what you're suggesting is the complete opposite of what the user would want and just plain bad.
-
Mar 24th, 2014, 08:41 PM
#4
Re: Form control to readjust size/position
That's true... I didn't really think about it like that.
-tg
-
Mar 24th, 2014, 11:58 PM
#5
Thread Starter
Hyperactive Member
Re: Form control to readjust size/position
when i run my application on a pc with lower resolution screen (and Bigger size in some cases ), controls get overlapped and hidden. I read a blog which suggests resizing and relocating all child control in line with parent resize ratio. would there be a better approach ?
-
Mar 25th, 2014, 12:08 AM
#6
Re: Form control to readjust size/position
Originally Posted by wiss.dev
when i run my application on a pc with lower resolution screen (and Bigger size in some cases ), controls get overlapped and hidden. I read a blog which suggests resizing and relocating all child control in line with parent resize ratio. would there be a better approach ?
As I said, resizing and repositioning controls based on their parent's size is quite reasonable but the size of the parent should be independent of the resolution of the screen. Follow the CodeBank link in my signature and check out my thread on Anchor & Dock and see if that sorts you out. If not then please be specific about the issue, including screenshots.
-
Mar 25th, 2014, 12:11 AM
#7
Re: Form control to readjust size/position
It might also be that the issue is DPI and not resolution. You can try changing the AutoScaleMode of the form from Font to Dpi and see if that fixes the issue. This often seems to be an issue when running an application on a laptop that was developed on a desktop machine.
-
Mar 25th, 2014, 05:21 PM
#8
Thread Starter
Hyperactive Member
Re: Form control to readjust size/position
I think the problem is in the width of my form (1369 * 707),
I do my dev on a laptop (1600 * 900), my test screen is 1280 * 1024 and because windows state is set to maximise the form width outsizes the screen and trims off some controls
-
Mar 25th, 2014, 05:24 PM
#9
Re: Form control to readjust size/position
You need to design your form to support the smallest size that you want to support and then use Dock, Anchor, etc, to scale up from there. If your form is bigger than the screen then that's an obvious issue and a developer mistake.
-
Mar 25th, 2014, 05:29 PM
#10
Thread Starter
Hyperactive Member
Re: Form control to readjust size/position
I agree.. Thanks for your help
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|