반응형
사용자의 양식 크기 조정을 비활성화하려면 어떻게합니까?
사용자의 양식 크기 조정을 비활성화하려면 어떻게합니까? 어떤 속성이 사용됩니까?
나는 시도 AutoSize
하고 AutoSizeMode
.
변경 FormBorderStyle
고정 값 중 하나에 : FixedSingle
, Fixed3D
, FixedDialog
또는 FixedToolWindow
.
이 FormBorderStyle
속성은 모양 범주에 있습니다.
또는 이것을 확인하십시오
// Define the border style of the form to a dialog box.
form1.FormBorderStyle = FormBorderStyle.FixedDialog;
// Set the MaximizeBox to false to remove the maximize box.
form1.MaximizeBox = false;
// Set the MinimizeBox to false to remove the minimize box.
form1.MinimizeBox = false;
// Set the start position of the form to the center of the screen.
form1.StartPosition = FormStartPosition.CenterScreen;
// Display the form as a modal dialog box.
form1.ShowDialog();
FormBorderStyle
재산을 사용 하여 만드십시오FixedSingle
this.FormBorderStyle = FormBorderStyle.FixedSingle;
FormBorderStyle
귀하의 재산 사용Form
this.FormBorderStyle = FormBorderStyle.FixedDialog;
양식의 MaximumSize
및 MinimumSize
속성을 사용 하면 양식 크기가 수정되고 양식의 기본값을 유지하면서 사용자가 양식의 크기를 조정할 수 없습니다 FormBorderStyle
.
this.MaximumSize = new Size(XX,YY);
this.MinimumSize = new Size(X,Y);
꽤 오래되었지만 향후 사용자를 위해 항상 이것을 사용합니다.
// lock form
this.MaximumSize = this.Size;
this.MinimumSize = this.Size;
이렇게하면 코드를 변경하지 않고도 Designer에서 양식의 크기를 항상 조정할 수 있습니다.
이 속성을 변경하고 디자인 타임에 시도하십시오
FormBorderStyle = FormBorderStyle.FixedDialog;
최대 크기, 최소 크기를 설정하고 창의 그리퍼 아이콘을 제거합니다.
속성 설정 (MaximumSize, MinimumSize, SizeGripStyle) :
this.MaximumSize = new System.Drawing.Size(500, 550);
this.MinimumSize = new System.Drawing.Size(500, 550);
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
참고 URL : https://stackoverflow.com/questions/5416380/how-do-i-disable-form-resizing-for-users
반응형
'Programing' 카테고리의 다른 글
서버에서받은 중복 헤더 (0) | 2020.07.28 |
---|---|
안드로이드에 커스텀 라디오 버튼 추가하기 (0) | 2020.07.28 |
Swift Xcode 6에서 버튼 텍스트를 변경하는 방법은 무엇입니까? (0) | 2020.07.28 |
jQuery UI-외부를 클릭하면 대화 상자 닫기 (0) | 2020.07.28 |
배열에서 임의의 값을 얻는 방법? (0) | 2020.07.28 |