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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Kirtan PatelRank #292 · 8.6K reputationPosted Aug 28, 2009, 4:40 AM EDT
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 :)
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Aug 27, 2009, 10:18 PM EDT
Maharaje124 reputationPosted Aug 27, 2009, 10:39 PM EDT
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?
Kirtan PatelRank #292 · 8.6K reputationPosted Aug 28, 2009, 4:03 AM EDT
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 :)
Maharaje124 reputationPosted Aug 28, 2009, 4:20 AM EDT
You are right but from where i understand hoe i can change the anchor? What Change? this is my problem
Thank you