本文整理汇总了C#中System.Windows.Forms.Button.NotifyDefault方法的典型用法代码示例。如果您正苦于以下问题:C# Button.NotifyDefault方法的具体用法?C# Button.NotifyDefault怎么用?C# Button.NotifyDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Button
的用法示例。
在下文中一共展示了Button.NotifyDefault方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeComponent
private static void InitializeComponent()
{
// Create a new instance of the form.
frmInputDialog = new Form();
lblPrompt = new Label();
btnOK = new Button();
btnCancel = new Button();
txtInput = new TextBox();
frmInputDialog.SuspendLayout();
//
// lblPrompt
//
lblPrompt.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right)));
lblPrompt.BackColor = SystemColors.Control;
lblPrompt.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((Byte)(0)));
lblPrompt.Location = new Point(12, 9);
lblPrompt.Name = "lblPrompt";
lblPrompt.Size = new Size(302, 82);
lblPrompt.TabIndex = 3;
//
// btnOK
//
btnOK.DialogResult = DialogResult.OK;
btnOK.FlatStyle = FlatStyle.Standard;
btnOK.Location = new Point(326, 8);
btnOK.Name = "btnOK";
btnOK.Size = new Size(64, 24);
btnOK.TabIndex = 1;
btnOK.Text = "&OK";
btnOK.Click += new EventHandler(btnOK_Click);
btnOK.NotifyDefault(true);
//
// btnCancel
//
btnCancel.DialogResult = DialogResult.Cancel;
btnCancel.FlatStyle = FlatStyle.Standard;
btnCancel.Location = new Point(326, 40);
btnCancel.Name = "btnCancel";
btnCancel.Size = new Size(64, 24);
btnCancel.TabIndex = 2;
btnCancel.Text = "&Cancel";
btnCancel.Click += new EventHandler(btnCancel_Click);
//
// txtInput
//
txtInput.Location = new Point(8, 100);
txtInput.Name = "txtInput";
txtInput.Size = new Size(379, 20);
txtInput.TabIndex = 0;
txtInput.Text = "";
//
// InputBoxDialog
//
frmInputDialog.AutoScaleBaseSize = new Size(5, 13);
frmInputDialog.ClientSize = new Size(398, 128);
frmInputDialog.Controls.Add(txtInput);
frmInputDialog.Controls.Add(btnCancel);
frmInputDialog.Controls.Add(btnOK);
frmInputDialog.Controls.Add(lblPrompt);
frmInputDialog.FormBorderStyle = FormBorderStyle.FixedDialog;
frmInputDialog.MaximizeBox = false;
frmInputDialog.MinimizeBox = false;
frmInputDialog.Name = "InputBoxDialog";
frmInputDialog.ResumeLayout(false);
frmInputDialog.AcceptButton = btnOK;
frmInputDialog.CancelButton = btnCancel;
frmInputDialog.Icon = _owner.Icon;
}