ユーザーのフォームのサイズ変更を無効にするにはどうすればいいですか? [重複] 質問する

ユーザーのフォームのサイズ変更を無効にするにはどうすればいいですか? [重複] 質問する

ユーザーのフォームのサイズ変更を無効にするにはどうすればいいですか? どのプロパティが使用されますか?

試してみましAutoSizeAutoSizeMode

ベストアンサー1

を、、またはのFormBorderStyleいずれかの固定値に変更します。FixedSingleFixed3DFixedDialogFixedToolWindow

この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();

おすすめ記事