Hi Friends
How i can maximize my form and the location of controls on the form Don't change?
Thank you
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Aug 28, 2009, 8:40 AM
you can Change Anchor From Property Window Look at below Image
if you Set Anchor like Image ( Left,Up) then you control will float - > left and Top Direction When resizing form
if you select none ,your controls position will retain the same as it is on the form.
Programatically Setting Anchor
--------------------------------------------
button1.Anchor = AnchorStyles.Bottom;
button1.Anchor = AnchorStyles.Left;
happy Coding :)
MaharajePosted Aug 28, 2009, 8:20 AM
You are right but from where i understand hoe i can change the anchor? What Change? this is my problem
Thank you
Kirtan PatelPosted Aug 28, 2009, 8:03 AM
you can do it Also From Code Behind
take a Look at Following Code
dont forget to mark "do you like answer" please it will give me some credits :)
private void button1_Click(object sender, EventArgs e)
{
//Change the State of the Form From Code Behind
this.WindowState = FormWindowState.Maximized;
// If you want to Miimize
// this.WindowState = FormWindowState.Minimized;
}
For you Control Position . you can Set Various option in Anchor Property of Control :)
MaharajePosted Aug 28, 2009, 2:39 AM
I know how i maximize my form my question is: when i maximized it the location of controls on it change and it's nice and this maximizing and minimizing are in runtime not in codeBehind?
Niradhip ChakrabortyPosted Aug 28, 2009, 2:18 AM