%&amp&#59;(*

I have a form created with a resolution of 1280 X 1024 pixels. When I run this application on a 800 X 600 pixels screen resolution my controls are not seen on the form.
How do make my controls & form adjust with the screen resolution. I do have AutoScaleMode as dpi


Re: Windows Forms General form AutoScaleMode

Suprotim Agarwal

Hi,

Ideally, you should develop your form with the minimum resolution in mind, in your case 800x600. Once done, you can always use the anchor/dock properties to adjust the form based on the resolution.

HTH,
Suprotim Agarwal

-----
http://www.dotnetcurry.com
-----






Re: Windows Forms General form AutoScaleMode

%&(*

Thanks
I have a two user controls on a form. The rest of the form is Tranparent. When I do the following in the form load event
it does not go to the bottom left of the screen. It is on the top right & overlap one another.
Any idea on how this can be done

UserControlDispDetails UserControlDispDetails1 = new UserControlDispDetails();
this.Controls.Add(UserControlDispDetails1);
UserControlDispDetails1.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;

UserControlInfo UserControlInfo1 = new UserControlInfo();
this.Controls.Add(UserControlInfo1);
UserControlInfo1.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;




Re: Windows Forms General form AutoScaleMode

Yu Guo ¨C MSFT

Hi, %&(*,

Based on my understanding, it seems that Anchor does not work in your application, does it

I think you may miss the meaning of anchor here.
http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.anchor(VS.80).aspx

Anchor is used to "determines how a control is resized with its parent" which means it will keep the distance to the edge of your parent container. (This time, Form)
For example, if you drag a control to your WinForm and set its Anchor to Bottom | Right, and run it. You will find that however you resize your WinForm, the distance from your control to the right bottom is not changed.
So, you should do like this

UserControlDispDetails1.Location = new Point(this.Width - UserControlDispDetails1.Width, this.Height - UserControlDispDetails1.Height);



That makes your UserControl1 show up in right bottom from beginning.

Hope this helps,
Regards