469,299 Members | 2,050 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

Relocate control after Maximize form

hi
How can we run the app on full-screen. I mean all the controls such as,
pictureboxe, button on the form would also be re-located when run application at maximize window state

Currently, when I maximize the form.. controls on the form are not
relocating.
How can we do this..
Nov 12 '08 #1
6 2859
Plater
7,872 Expert 4TB
attach a handler to one(or more?) of the window size events (resize, resizebegin, resizeend, sizechanged) and recompute where the controls sit
Nov 12 '08 #2
Thanx alot Mr. Plater

is it posible to solve this problem by using .Net function

this.ScaleControl(new SizeF(15, 30), BoundsSpecified.All);
If yes please explain how can I do that.
Nov 15 '08 #3
joedeene
583 512MB
For your situation when the form is maximized, do you want the controls to get bigger also? If not, you can just use the Control.Dock Property.

joedeene
Nov 15 '08 #4
The problem was solved by using Scale function for each control with Maximize Scale Factor which calculate by divide size of form in case of maximize over size of form in case of normal .

Question is this solution need to add about a pixel or 2 for location of control,

How to can I make it accurate (without adding pixel)?


Second Question How to prevent editing of Textbox?


Last Question , when I set text at Textbox and minimize form then return to it again all text at textbox was clear. Do you know why something like this happen ?

Thanks for advance.
Nov 16 '08 #5
balabaster
797 Expert 512MB
You know, you'd think someone would have developed something that would do this by now but I've yet to come across anything useful.

I tend to use a combination of sizable panels, dockable panels and basic math to complete this task. I create a "RenderControl" method that places and sizes my controls according to the form size and then in my load and resize event handlers I call my RenderControl method.
Nov 17 '08 #6
Plater
7,872 Expert 4TB
To bala: I believe WPF or whatever their latest shebang is does it, I know I had a heck of time placing controls with it.

As for preventing textbox editing, set the ReadOnly property to true.
As to why the contents are getting lost, I would say it is something to do with how you handle your resizing.
Nov 17 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by lauren quantrell | last post: by
3 posts views Thread by guy | last post: by
1 post views Thread by Kenneth Siewers Møller | last post: by
1 post views Thread by JDeats | last post: by
3 posts views Thread by Joseph Gruber | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.