Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix the size of a C# Windows Form Application from resizing

Tags:

c#

winforms

I have a C# Windows Form application that I am working on and when I build the form on the development PC it looks fine but when I move the exe onto another machine everything resizes. This then through's out the picturebox and button controls. I have specified the size of the controls in VS but it seems to ignore these. I have also fixed the minimum and maximum sizes to be the same but this has not resolved the issue.

Can anyone point me the direction of something that I have missed as I need to fix the size of the controls.

Thanks in advance.

New PCenter image description here

Development PC enter image description here

this.interviewPb.Image = ((System.Drawing.Image(resources.GetObject("interviewPb.Image")));
this.interviewPb.Location = new System.Drawing.Point(771, 366);
this.interviewPb.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.interviewPb.Name = "interviewPb";
this.interviewPb.Size = new System.Drawing.Size(393, 492);
this.interviewPb.TabIndex = 9;
this.interviewPb.TabStop = false;
like image 516
aHunter Avatar asked Jan 28 '14 12:01

aHunter


1 Answers

Try setting the AutoScaleMode property for the form to none. This should prevent resizing even if the DPI resolution is different on different machines.

like image 117
Thorsten Dittmar Avatar answered Oct 04 '22 17:10

Thorsten Dittmar