![](/img/trans.png)
[英]How can I fix the form size in a C# Windows Forms application and not to let user change its size?
[英]How to fix the size of a C# Windows Form Application from resizing
我有一個C#Windows窗體應用程序,我正在研究,當我在開發PC上構建表單時它看起來很好但是當我將exe移動到另一台機器上時,所有內容都會調整大小。 然后通過圖片框和按鈕控件。 我在VS中指定了控件的大小,但它似乎忽略了這些。 我還修改了最小和最大尺寸相同但這還沒有解決問題。
任何人都可以指出我已經錯過的東西的方向,因為我需要修復控件的大小。
提前致謝。
新PC
開發PC
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;
嘗試將表單的AutoScaleMode
屬性設置為none
。 即使DPI分辨率在不同的機器上不同,這也應該防止調整大小。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.