<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FGUI_Windows_Form%2FControl</id>
		<title>Csharp/C Sharp/GUI Windows Form/Control - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FGUI_Windows_Form%2FControl"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Control&amp;action=history"/>
		<updated>2026-04-30T01:39:23Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Control&amp;diff=108&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Control&amp;diff=108&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:18Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Control&amp;diff=109&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Control&amp;diff=109&amp;oldid=prev"/>
				<updated>2010-05-26T11:33:10Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Add a Control Programmatically==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class DynamicCheckBox : System.Windows.Forms.Form {&lt;br /&gt;
    public DynamicCheckBox(){&lt;br /&gt;
    &lt;br /&gt;
        string[] foods = {&amp;quot;A&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;H&amp;quot;, &amp;quot;I&amp;quot;, &amp;quot;J&amp;quot;, &amp;quot;K&amp;quot;, &amp;quot;L&amp;quot;};&lt;br /&gt;
        int topPosition = 10;&lt;br /&gt;
        foreach (string food in foods)&lt;br /&gt;
        {&lt;br /&gt;
            // Create a new check box.&lt;br /&gt;
            CheckBox checkBox = new CheckBox();&lt;br /&gt;
            checkBox.Left = 10;&lt;br /&gt;
            checkBox.Top = topPosition;&lt;br /&gt;
            topPosition += 30;&lt;br /&gt;
            checkBox.Text = food;&lt;br /&gt;
            // Add the check box to the form.&lt;br /&gt;
            this.Controls.Add(checkBox);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main(){&lt;br /&gt;
       Application.Run(new DynamicCheckBox());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Change Image alignment inside a Control==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
    using System;&lt;br /&gt;
  using System.Drawing;&lt;br /&gt;
  using System.Collections;&lt;br /&gt;
  using System.ruponentModel;&lt;br /&gt;
  using System.Windows.Forms;&lt;br /&gt;
  using System.Data;&lt;br /&gt;
  public class ButtonForm : System.Windows.Forms.Form&lt;br /&gt;
  {&lt;br /&gt;
    private System.Windows.Forms.Button btnImage;&lt;br /&gt;
    private System.Windows.Forms.Button btnStandard;&lt;br /&gt;
    // Hold the current text alignment&lt;br /&gt;
    ContentAlignment currAlignment = ContentAlignment.MiddleCenter;&lt;br /&gt;
    int currEnumPos = 0;&lt;br /&gt;
    &lt;br /&gt;
    public ButtonForm()&lt;br /&gt;
    {&lt;br /&gt;
      InitializeComponent();&lt;br /&gt;
      // Set btnStandard as default accept.&lt;br /&gt;
      this.AcceptButton = btnStandard;&lt;br /&gt;
      CenterToScreen();&lt;br /&gt;
    }&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      this.btnStandard = new System.Windows.Forms.Button();&lt;br /&gt;
      this.btnImage = new System.Windows.Forms.Button();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      // &lt;br /&gt;
      // btnStandard&lt;br /&gt;
      // &lt;br /&gt;
      this.btnStandard.Font = new System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 12F);&lt;br /&gt;
      this.btnStandard.ForeColor = System.Drawing.SystemColors.ControlText;&lt;br /&gt;
      this.btnStandard.Location = new System.Drawing.Point(16, 80);&lt;br /&gt;
      this.btnStandard.Name = &amp;quot;btnStandard&amp;quot;;&lt;br /&gt;
      this.btnStandard.Size = new System.Drawing.Size(312, 88);&lt;br /&gt;
      this.btnStandard.TabIndex = 2;&lt;br /&gt;
      this.btnStandard.Text = &amp;quot;Click to change the Image alignment&amp;quot;;&lt;br /&gt;
      this.btnStandard.Click += new System.EventHandler(this.btnStandard_Click);&lt;br /&gt;
      // &lt;br /&gt;
      // btnImage&lt;br /&gt;
      // &lt;br /&gt;
      this.btnImage.Font = new System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 20F, System.Drawing.FontStyle.Bold);&lt;br /&gt;
      this.btnImage.Image = new Bitmap(&amp;quot;winter.jpg&amp;quot;);&lt;br /&gt;
      this.btnImage.Location = new System.Drawing.Point(16, 192);&lt;br /&gt;
      this.btnImage.Name = &amp;quot;btnImage&amp;quot;;&lt;br /&gt;
      this.btnImage.Size = new System.Drawing.Size(312, 72);&lt;br /&gt;
      this.btnImage.TabIndex = 3;&lt;br /&gt;
      this.btnImage.Text = &amp;quot;Image Button&amp;quot;;&lt;br /&gt;
      this.btnImage.TextAlign = System.Drawing.ContentAlignment.TopCenter;&lt;br /&gt;
      // &lt;br /&gt;
      // ButtonForm&lt;br /&gt;
      // &lt;br /&gt;
      this.AcceptButton = this.btnStandard;&lt;br /&gt;
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
      this.ClientSize = new System.Drawing.Size(340, 269);&lt;br /&gt;
      this.Controls.AddRange(new System.Windows.Forms.Control[] {this.btnImage,&lt;br /&gt;
                                     this.btnStandard,&lt;br /&gt;
                                    });&lt;br /&gt;
      this.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;&lt;br /&gt;
      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;&lt;br /&gt;
      this.Name = &amp;quot;ButtonForm&amp;quot;;&lt;br /&gt;
      this.Text = &amp;quot;Buttons&amp;quot;;&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    protected void btnStandard_Click (object sender, System.EventArgs e)&lt;br /&gt;
    {      &lt;br /&gt;
      Array values = Enum.GetValues(currAlignment.GetType());&lt;br /&gt;
    &lt;br /&gt;
      currEnumPos++;&lt;br /&gt;
      if(currEnumPos &amp;gt;= values.Length)&lt;br /&gt;
        currEnumPos = 0;&lt;br /&gt;
      &lt;br /&gt;
      currAlignment = (ContentAlignment)ContentAlignment.Parse(currAlignment.GetType(), &lt;br /&gt;
              values.GetValue(currEnumPos).ToString());&lt;br /&gt;
      btnImage.ImageAlign = currAlignment;&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main(string[] args) &lt;br /&gt;
    {&lt;br /&gt;
      Application.Run(new ButtonForm());&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Control Enabled==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
class MainWindow : Form {&lt;br /&gt;
    private TextBox firstNameBox = new TextBox();&lt;br /&gt;
    private Button btnShowControls = new Button();&lt;br /&gt;
    public MainWindow() {&lt;br /&gt;
        this.Text = &amp;quot;Simple Controls&amp;quot;;&lt;br /&gt;
        this.Width = 300;&lt;br /&gt;
        this.Height = 200;&lt;br /&gt;
        CenterToScreen();&lt;br /&gt;
        firstNameBox.Text = &amp;quot;Hello&amp;quot;;&lt;br /&gt;
        firstNameBox.Size = new Size(150, 50);&lt;br /&gt;
        firstNameBox.Location = new Point(10, 10);&lt;br /&gt;
        this.Controls.Add(firstNameBox);&lt;br /&gt;
        btnShowControls.Text = &amp;quot;Click Me&amp;quot;;&lt;br /&gt;
        btnShowControls.Size = new Size(90, 30);&lt;br /&gt;
        btnShowControls.Location = new Point(10, 70);&lt;br /&gt;
        btnShowControls.BackColor = Color.DodgerBlue;&lt;br /&gt;
        btnShowControls.Click += new EventHandler(btnShowControls_Clicked);&lt;br /&gt;
        this.Controls.Add(btnShowControls);&lt;br /&gt;
    }&lt;br /&gt;
    private void btnShowControls_Clicked(object sender, EventArgs e) {&lt;br /&gt;
        string ctrlInfo = &amp;quot;&amp;quot;;&lt;br /&gt;
        foreach (Control c in this.Controls) {&lt;br /&gt;
            ctrlInfo += string.Format(&amp;quot;Control: {0}\n&amp;quot;,c.ToString());&lt;br /&gt;
        }&lt;br /&gt;
        MessageBox.Show(ctrlInfo, &amp;quot;Controls on Form&amp;quot;);&lt;br /&gt;
        DisableAllButtons();&lt;br /&gt;
    }&lt;br /&gt;
    private void DisableAllButtons() {&lt;br /&gt;
        foreach (Control c in this.Controls) {&lt;br /&gt;
            if (c is Button)&lt;br /&gt;
                ((Button)c).Enabled = false;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main(string[] args) {&lt;br /&gt;
        Application.Run(new MainWindow());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Control renderer Demo: CheckBox==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Windows.Forms.VisualStyles;&lt;br /&gt;
public class Form1 : Form&lt;br /&gt;
{&lt;br /&gt;
      public Form1() {&lt;br /&gt;
            InitializeComponent();&lt;br /&gt;
            &lt;br /&gt;
      }&lt;br /&gt;
    private void ControlRenderer_Paint(object sender, PaintEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      &lt;br /&gt;
        CheckBoxRenderer.DrawCheckBox(e.Graphics, new Point(10,10),&lt;br /&gt;
          new Rectangle(10,10,110,15), &amp;quot;Style checkbox&amp;quot;, Font,false, CheckBoxState.CheckedNormal);&lt;br /&gt;
      &lt;br /&gt;
    }&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      // &lt;br /&gt;
      // ControlRenderer&lt;br /&gt;
      // &lt;br /&gt;
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);&lt;br /&gt;
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;&lt;br /&gt;
      this.ClientSize = new System.Drawing.Size(292, 266);&lt;br /&gt;
      this.Name = &amp;quot;ControlRenderer&amp;quot;;&lt;br /&gt;
      this.Text = &amp;quot;ControlRenderer&amp;quot;;&lt;br /&gt;
      this.Paint += new System.Windows.Forms.PaintEventHandler(this.ControlRenderer_Paint);&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
      [STAThread]&lt;br /&gt;
      static void Main()&lt;br /&gt;
      {&lt;br /&gt;
        Application.EnableVisualStyles();&lt;br /&gt;
        Application.Run(new Form1());&lt;br /&gt;
      }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Control style: resize and redraw==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
  using System;&lt;br /&gt;
  using System.Drawing;&lt;br /&gt;
  using System.Collections;&lt;br /&gt;
  using System.ruponentModel;&lt;br /&gt;
  using System.Windows.Forms;&lt;br /&gt;
  using System.Data;&lt;br /&gt;
  public class Form1 : System.Windows.Forms.Form&lt;br /&gt;
  {&lt;br /&gt;
    private System.Windows.Forms.Button btnGetStyles;&lt;br /&gt;
    private System.ruponentModel.Container components;&lt;br /&gt;
    public Form1()&lt;br /&gt;
    {&lt;br /&gt;
      InitializeComponent();&lt;br /&gt;
      SetStyle(ControlStyles.ResizeRedraw, true);&lt;br /&gt;
    }&lt;br /&gt;
    protected override void Dispose( bool disposing )&lt;br /&gt;
    {&lt;br /&gt;
      if( disposing )&lt;br /&gt;
      {&lt;br /&gt;
        if (components != null) &lt;br /&gt;
        {&lt;br /&gt;
          components.Dispose();&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      base.Dispose( disposing );&lt;br /&gt;
    }&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      this.btnGetStyles = new System.Windows.Forms.Button();&lt;br /&gt;
      this.btnGetStyles.Location = new System.Drawing.Point(24, 64);&lt;br /&gt;
      this.btnGetStyles.Size = new System.Drawing.Size(160, 23);&lt;br /&gt;
      this.btnGetStyles.TabIndex = 0;&lt;br /&gt;
      this.btnGetStyles.Text = &amp;quot;Get Form Styles&amp;quot;;&lt;br /&gt;
      this.btnGetStyles.Click += new System.EventHandler(this.btnGetStyles_Click);&lt;br /&gt;
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
      this.ClientSize = new System.Drawing.Size(211, 104);&lt;br /&gt;
      this.Controls.AddRange(new System.Windows.Forms.Control[] {this.btnGetStyles});&lt;br /&gt;
      this.Text = &amp;quot;A Form with Style!&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    [STAThread]&lt;br /&gt;
    static void Main() &lt;br /&gt;
    {&lt;br /&gt;
      Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
    private void btnGetStyles_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      MessageBox.Show(GetStyle(ControlStyles.ResizeRedraw).ToString(), &lt;br /&gt;
        &amp;quot;Do you have ResizeRedraw?&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Get all controls on a form window==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
    using System;  &lt;br /&gt;
  using System.Drawing;&lt;br /&gt;
  using System.Windows.Forms;&lt;br /&gt;
    class MyForm : Form&lt;br /&gt;
  {&lt;br /&gt;
    private TextBox firstNameBox = new TextBox(); &lt;br /&gt;
    private Button btnShowControls = new Button();&lt;br /&gt;
    &lt;br /&gt;
    MyForm()&lt;br /&gt;
    {&lt;br /&gt;
      this.Text = &amp;quot;Controls in the raw&amp;quot;;&lt;br /&gt;
      // Add a new text box.&lt;br /&gt;
      firstNameBox.Text = &amp;quot;Chucky&amp;quot;;&lt;br /&gt;
      firstNameBox.Size = new Size(150, 50);&lt;br /&gt;
      firstNameBox.Location = new Point(10, 10);&lt;br /&gt;
      this.Controls.Add(firstNameBox);&lt;br /&gt;
      // Add a new button.&lt;br /&gt;
      btnShowControls.Text = &amp;quot;Examine Controls collection&amp;quot;;&lt;br /&gt;
      btnShowControls.Size = new Size(90, 90);&lt;br /&gt;
      btnShowControls.Location = new Point(10, 70);&lt;br /&gt;
      btnShowControls.Click += &lt;br /&gt;
        new EventHandler(btnShowControls_Clicked);&lt;br /&gt;
      this.Controls.Add(btnShowControls);&lt;br /&gt;
      CenterToScreen();&lt;br /&gt;
    }&lt;br /&gt;
    protected void btnShowControls_Clicked(object sender, EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      Control.ControlCollection coll = this.Controls;&lt;br /&gt;
      foreach(Control c in coll) {&lt;br /&gt;
        if(c != null)&lt;br /&gt;
          Console.WriteLine(c.Text, &amp;quot;Index numb: &amp;quot; + coll.GetChildIndex(c, false));   &lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
        public static int Main(string[] args)&lt;br /&gt;
        {&lt;br /&gt;
      Application.Run(new MyForm());&lt;br /&gt;
      return 0;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Use Control.GetType to check the control type==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
   &lt;br /&gt;
class CustomCheckBox: Form&lt;br /&gt;
{&lt;br /&gt;
     public static void Main()&lt;br /&gt;
     {&lt;br /&gt;
          Application.Run(new CustomCheckBox());&lt;br /&gt;
     }&lt;br /&gt;
     public CustomCheckBox()&lt;br /&gt;
     {&lt;br /&gt;
          int      cyText = Font.Height;&lt;br /&gt;
          int      cxText = cyText / 2;&lt;br /&gt;
          FontStyle[] afs = { FontStyle.Bold,      FontStyle.Italic, &lt;br /&gt;
                              FontStyle.Underline, FontStyle.Strikeout };&lt;br /&gt;
   &lt;br /&gt;
          Label label    = new Label();&lt;br /&gt;
          label.Parent   = this;&lt;br /&gt;
          label.Text     = &amp;quot;Sample Text&amp;quot;;&lt;br /&gt;
   &lt;br /&gt;
          for (int i = 0; i &amp;lt; 4; i++)&lt;br /&gt;
          {&lt;br /&gt;
               FontStyleCheckBox chkbox = new FontStyleCheckBox();&lt;br /&gt;
               chkbox.Parent = this;&lt;br /&gt;
               chkbox.Text = afs[i].ToString();&lt;br /&gt;
               chkbox.fontstyle = afs[i];&lt;br /&gt;
               chkbox.Location = new Point(2 * cxText, &lt;br /&gt;
                                               (4 + 3 * i) * cyText / 2);&lt;br /&gt;
               chkbox.Size = new Size(12 * cxText, cyText);&lt;br /&gt;
               chkbox.CheckedChanged += new EventHandler(CheckBoxOnCheckedChanged);&lt;br /&gt;
          }&lt;br /&gt;
     }&lt;br /&gt;
     void CheckBoxOnCheckedChanged(object obj, EventArgs ea)&lt;br /&gt;
     {&lt;br /&gt;
          FontStyle fs = 0;&lt;br /&gt;
          Label     label = null;&lt;br /&gt;
   &lt;br /&gt;
          for (int i = 0; i &amp;lt; Controls.Count; i++)&lt;br /&gt;
          {&lt;br /&gt;
               Control ctrl = Controls[i];&lt;br /&gt;
   &lt;br /&gt;
               if (ctrl.GetType() == typeof(Label))&lt;br /&gt;
                    label = (Label) ctrl;&lt;br /&gt;
               else if (ctrl.GetType() == typeof(FontStyleCheckBox))&lt;br /&gt;
                    if (((FontStyleCheckBox) ctrl).Checked)&lt;br /&gt;
                         fs |= ((FontStyleCheckBox) ctrl).fontstyle;&lt;br /&gt;
          }&lt;br /&gt;
          label.Font = new Font(label.Font, fs);&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
class FontStyleCheckBox: CheckBox&lt;br /&gt;
{&lt;br /&gt;
     public FontStyle fontstyle;&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>