本文整理汇总了C#中System.Windows.Forms.CheckBox.Show方法的典型用法代码示例。如果您正苦于以下问题:C# CheckBox.Show方法的具体用法?C# CheckBox.Show怎么用?C# CheckBox.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.CheckBox
的用法示例。
在下文中一共展示了CheckBox.Show方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDrawColumnHeader
protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
{
base.OnDrawColumnHeader(e);
if (e.ColumnIndex == 0)
{
var headerCheckBox = new CheckBox {Text = "", Visible = true};
SuspendLayout();
e.DrawBackground();
headerCheckBox.BackColor = Color.Transparent;
headerCheckBox.UseVisualStyleBackColor = true;
headerCheckBox.BackgroundImage = Resources.ListViewHeaderCheckboxBackgroud;
headerCheckBox.SetBounds(e.Bounds.X, e.Bounds.Y,
headerCheckBox.GetPreferredSize(new Size(e.Bounds.Width, e.Bounds.Height)).
Width,
headerCheckBox.GetPreferredSize(new Size(e.Bounds.Width, e.Bounds.Height)).
Height);
headerCheckBox.Size =
new Size(headerCheckBox.GetPreferredSize(new Size(e.Bounds.Width - 1, e.Bounds.Height)).Width + 1,
e.Bounds.Height);
headerCheckBox.Location = new Point(4, 0);
Controls.Add(headerCheckBox);
headerCheckBox.Show();
headerCheckBox.BringToFront();
e.DrawText(TextFormatFlags.VerticalCenter | TextFormatFlags.Left);
headerCheckBox.CheckedChanged += OnHeaderCheckboxCheckedChanged;
ResumeLayout(true);
}
else
{
e.DrawDefault = true;
}
}
示例2: AgentGUI
public AgentGUI( string caption )
{
m_Id = ++m_IdCounter;
RadioGroupUpdater[] tmpOld = m_UpdaterList;
m_UpdaterList = new RadioGroupUpdater[m_Id];
if ( tmpOld != null )
for ( int i = 0; i < tmpOld.Length; i++ )
m_UpdaterList[i] = tmpOld[i];
m_UpdaterList[m_Id-1] = new RadioGroupUpdater( SyncPlayerSelectors );
this.Text = caption;
this.Width = 430;
this.Height = 340;
this.MaximizeBox = false;
this.FormBorderStyle = FormBorderStyle.FixedSingle;
m_GroupBoxPlayer = new GroupBox();
m_GroupBoxPlayer.Text = "Play as";
m_GroupBoxPlayer.Width = 100;
m_GroupBoxPlayer.Height = 150;
m_GroupBoxPlayer.Left = 10;
m_GroupBoxPlayer.Top = 25;
m_GroupBoxPlayer.Show();
this.Controls.Add( m_GroupBoxPlayer );
m_PlayerLight = new RadioButton();
m_PlayerLight.Text = "Light";
m_PlayerLight.Width = 50;
m_PlayerLight.Left = 25;
m_PlayerLight.Top = 50;
m_PlayerLight.Checked = true;
m_PlayerLight.CheckedChanged += new EventHandler( m_PlayerSelect_Click );
m_PlayerLight.Show();
m_GroupBoxPlayer.Controls.Add( m_PlayerLight );
m_PlayerDark = new RadioButton();
m_PlayerDark.Text = "Dark";
m_PlayerDark.Width = 50;
m_PlayerDark.Left = 25;
m_PlayerDark.Top = 80;
m_PlayerDark.CheckedChanged += new EventHandler( m_PlayerSelect_Click );
m_PlayerDark.Show();
m_GroupBoxPlayer.Controls.Add( m_PlayerDark );
m_PlayerNone = new RadioButton();
m_PlayerNone.Text = "None";
m_PlayerNone.Width = 50;
m_PlayerNone.Left = 25;
m_PlayerNone.Top = 20;
m_PlayerNone.CheckedChanged += new EventHandler( m_PlayerSelect_Click );
m_PlayerNone.Show();
m_GroupBoxPlayer.Controls.Add( m_PlayerNone );
m_PlayerBoth = new RadioButton();
m_PlayerBoth.Text = "Both";
m_PlayerBoth.Width = 50;
m_PlayerBoth.Left = 25;
m_PlayerBoth.Top = 110;
m_PlayerBoth.CheckedChanged += new EventHandler( m_PlayerSelect_Click );
m_PlayerBoth.Show();
m_GroupBoxPlayer.Controls.Add( m_PlayerBoth );
m_EvaluatorLabel = new Label();
m_EvaluatorLabel.Text = "Evaluator";
m_EvaluatorLabel.Left = 10;
m_EvaluatorLabel.Top = 190;
m_EvaluatorLabel.AutoSize = true;
m_EvaluatorLabel.Show();
this.Controls.Add( m_EvaluatorLabel );
m_PluginSelector = new ComboBox();
m_PluginSelector.DropDownStyle = ComboBoxStyle.DropDownList;
m_PluginSelector.Left = 10;
m_PluginSelector.Top = 210;
m_PluginSelector.Width = 100;
m_PluginSelector.Items.Add( "None" );
m_PluginSelector.SelectedIndex = 0;
m_PluginSelector.Show();
this.Controls.Add( m_PluginSelector );
m_LearnPanel = new Panel();
m_LearnPanel.BorderStyle = BorderStyle.None;
m_LearnPanel.Left = 5;
m_LearnPanel.Top = 240;
m_LearnPanel.Width = 100;
m_LearnPanel.Height = 25;
m_LearnPanel.Show();
this.Controls.Add( m_LearnPanel );
m_Learn = new CheckBox();
m_Learn.Text = "Learn";
m_Learn.Left = 5;
m_Learn.Top = 0;
m_Learn.Checked = false;
m_Learn.CheckedChanged += new EventHandler( m_Learn_CheckedChanged );
m_Learn.Show();
m_LearnPanel.Controls.Add( m_Learn );
if (m_Id == 1)
m_Learn.Checked = true;
//.........这里部分代码省略.........