当前位置: 首页>>代码示例>>C#>>正文


C# RadioButton.PerformClick方法代码示例

本文整理汇总了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 ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:15,代码来源:RadioButtonTest.cs

示例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
                    {
开发者ID:GHScan,项目名称:DailyProjects,代码行数:67,代码来源:Program.cs


注:本文中的System.Windows.Forms.RadioButton.PerformClick方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。