本文整理汇总了C#中System.Windows.Forms.RadioButton.PerformClick方法的典型用法代码示例。如果您正苦于以下问题:C# RadioButton.PerformClick方法的具体用法?C# RadioButton.PerformClick怎么用?C# RadioButton.PerformClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.RadioButton
的用法示例。
在下文中一共展示了RadioButton.PerformClick方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PanelClickTest
public void PanelClickTest ()
{
Form myForm = new Form ();
myForm.ShowInTaskbar = false;
RadioButton rButton1 = new RadioButton ();
rButton1.Select ();
rButton1.Visible = true;
myForm.Controls.Add (rButton1);
eventhandled = false;
rButton1.Click += new EventHandler (RadioButton_EventHandler);
myForm.Show ();
rButton1.PerformClick ();
Assert.AreEqual (true, eventhandled, "#2");
myForm.Dispose ();
}
示例2: Main
//.........这里部分代码省略.........
panelFill.ResumeLayout(false);
panelFill.PerformLayout();
statusStrip.ResumeLayout(false);
statusStrip.PerformLayout();
form.ResumeLayout(false);
form.PerformLayout();
}
radioButtonText.Click += (o, e) =>
{
textBoxInput.Text = "";
textBoxOutput.Text = "";
var commonUse = new List<string>();
commonUse.Add(Encoding.Unicode.WebName);
commonUse.Add(Encoding.UTF8.WebName);
commonUse.Add(Encoding.Default.WebName);
commonUse.Add(Encoding.UTF7.WebName);
commonUse.Add(Encoding.UTF32.WebName);
var fullList = Encoding.GetEncodings().Select(i=>i.GetEncoding().WebName);
comboBox.DataSource = commonUse.Concat(fullList.Except(commonUse)).ToArray();
};
radioButtonNumber.Click += (o, e) =>
{
textBoxInput.Text = "";
textBoxOutput.Text = "";
comboBox.DataSource = new string[] { "unsigned oct", "signed oct", "hex", };
};
radioButtonText.PerformClick();
Func<byte[], string> formatBytes = bytes =>
{
if (bytes == null || bytes.Length == 0) return string.Empty;
var buf = new StringBuilder();
foreach (byte b in bytes) buf.AppendFormat("{0:x2} ", b);
buf.Remove(buf.Length - 1, 1);
return buf.ToString();
};
EventHandler intput2output = (o, e) =>
{
textBoxOutput.Text = string.Empty;
if (string.IsNullOrEmpty(textBoxInput.Text)) return;
if (radioButtonText.Checked)
{
try
{
Encoding encoding = Encoding.GetEncoding(comboBox.Text);
textBoxOutput.Text = formatBytes(encoding.GetBytes(textBoxInput.Text));
}
catch (Exception _e)
{
statusLabel.Text = _e.Message.Replace("\r\n", "\t");
}
}
else
{
try
{