<?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%2FCSharp_Tutorial%2FGUI_Windows_Forms%2FCheckBox</id>
		<title>Csharp/CSharp Tutorial/GUI Windows Forms/CheckBox - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FGUI_Windows_Forms%2FCheckBox"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/CheckBox&amp;action=history"/>
		<updated>2026-04-29T20:35:04Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/CheckBox&amp;diff=5381&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/CheckBox&amp;diff=5381&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</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/CSharp_Tutorial/GUI_Windows_Forms/CheckBox&amp;diff=5382&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/CheckBox&amp;diff=5382&amp;oldid=prev"/>
				<updated>2010-05-26T12:15:11Z</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 CheckBox to a Form==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class CheckBoxFormDemo{&lt;br /&gt;
    [STAThread]&lt;br /&gt;
    public static void Main(string[] args)&lt;br /&gt;
    {&lt;br /&gt;
        Application.Run(new CheckBoxForm());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public partial class CheckBoxForm : Form&lt;br /&gt;
{&lt;br /&gt;
    public CheckBoxForm()&lt;br /&gt;
    {&lt;br /&gt;
        InitializeComponent();&lt;br /&gt;
    }&lt;br /&gt;
    protected override void OnLoad(EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        base.OnLoad(e);&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;};&lt;br /&gt;
        this.SuspendLayout();&lt;br /&gt;
        int topPosition = 10;&lt;br /&gt;
        foreach (string food in foods)&lt;br /&gt;
        {&lt;br /&gt;
            CheckBox checkBox = new CheckBox();&lt;br /&gt;
            checkBox.Top = topPosition;&lt;br /&gt;
            checkBox.Left = 10;&lt;br /&gt;
            checkBox.Text = food;&lt;br /&gt;
            topPosition += 30;&lt;br /&gt;
            panel1.Controls.Add(checkBox);&lt;br /&gt;
        }&lt;br /&gt;
        this.ResumeLayout();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
partial class CheckBoxForm&lt;br /&gt;
{&lt;br /&gt;
    private System.ruponentModel.IContainer components = null;&lt;br /&gt;
    protected override void Dispose(bool disposing)&lt;br /&gt;
    {&lt;br /&gt;
        if (disposing &amp;amp;&amp;amp; (components != null))&lt;br /&gt;
        {&lt;br /&gt;
            components.Dispose();&lt;br /&gt;
        }&lt;br /&gt;
        base.Dispose(disposing);&lt;br /&gt;
    }&lt;br /&gt;
    #region Windows Form Designer generated code&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
        this.panel1 = new System.Windows.Forms.Panel();&lt;br /&gt;
        this.SuspendLayout();&lt;br /&gt;
        // &lt;br /&gt;
        // panel1&lt;br /&gt;
        // &lt;br /&gt;
        this.panel1.AutoScroll = true;&lt;br /&gt;
        this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;&lt;br /&gt;
        this.panel1.Location = new System.Drawing.Point(0, 0);&lt;br /&gt;
        this.panel1.Name = &amp;quot;panel1&amp;quot;;&lt;br /&gt;
        this.panel1.Size = new System.Drawing.Size(292, 266);&lt;br /&gt;
        this.panel1.TabIndex = 0;&lt;br /&gt;
        // &lt;br /&gt;
        // CheckBoxForm&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.Controls.Add(this.panel1);&lt;br /&gt;
        this.Name = &amp;quot;CheckBoxForm&amp;quot;;&lt;br /&gt;
        this.Text = &amp;quot;CheckBoxForm&amp;quot;;&lt;br /&gt;
        this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    #endregion&lt;br /&gt;
    private System.Windows.Forms.Panel panel1;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change Label font by CheckBoxes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class LabelFontChangedByCheckBoxes : Form&lt;br /&gt;
{&lt;br /&gt;
  Label lbl;&lt;br /&gt;
  Panel pnl;&lt;br /&gt;
  FontStyle[] theStyles;&lt;br /&gt;
  public LabelFontChangedByCheckBoxes()&lt;br /&gt;
  {&lt;br /&gt;
    Size = new Size(300,250);&lt;br /&gt;
    lbl = new Label();&lt;br /&gt;
    lbl.Parent = this;&lt;br /&gt;
    lbl.Text = &amp;quot;test&amp;quot;;&lt;br /&gt;
    lbl.Location = new Point(0,0);&lt;br /&gt;
    lbl.AutoSize = true;&lt;br /&gt;
    lbl.BorderStyle = BorderStyle.Fixed3D;&lt;br /&gt;
    int yDelta = lbl.Height + 10;&lt;br /&gt;
    &lt;br /&gt;
    FontStyle theEnum = new FontStyle();&lt;br /&gt;
    theStyles = (FontStyle[])Enum.GetValues(theEnum.GetType());&lt;br /&gt;
    pnl = new Panel();&lt;br /&gt;
    pnl.Parent = this;&lt;br /&gt;
    pnl.Location = new Point(0, yDelta );&lt;br /&gt;
    pnl.Size = new Size(150, (theStyles.Length + 1) * yDelta);&lt;br /&gt;
    pnl.BorderStyle = BorderStyle.FixedSingle;&lt;br /&gt;
&lt;br /&gt;
    int i = 1;&lt;br /&gt;
    CheckBox cb;&lt;br /&gt;
    foreach (FontStyle style in theStyles)&lt;br /&gt;
    {&lt;br /&gt;
      cb = new CheckBox();&lt;br /&gt;
      cb.Parent = pnl;&lt;br /&gt;
      cb.Location = new Point(25, (yDelta * (i - 1)) + 10);&lt;br /&gt;
      cb.Size = new Size(75,20);&lt;br /&gt;
      cb.Text = style.ToString();&lt;br /&gt;
      cb.Tag = style;&lt;br /&gt;
      cb.CheckedChanged += new System.EventHandler(cb_CheckedChanged);&lt;br /&gt;
      if (cb.Text == &amp;quot;Regular&amp;quot;)&lt;br /&gt;
        cb.Checked = true;&lt;br /&gt;
      i++;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new LabelFontChangedByCheckBoxes());&lt;br /&gt;
  }&lt;br /&gt;
  private void cb_CheckedChanged(object sender, EventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    FontStyle fs = 0;&lt;br /&gt;
    for (int i = 0; i &amp;lt; pnl.Controls.Count; i++)&lt;br /&gt;
    {&lt;br /&gt;
      CheckBox cb = (CheckBox)pnl.Controls[i];&lt;br /&gt;
      if (cb.Checked)&lt;br /&gt;
        fs |= (FontStyle)cb.Tag;&lt;br /&gt;
      if (((CheckBox)pnl.Controls[i]).Checked)&lt;br /&gt;
        fs |= (FontStyle)((CheckBox)pnl.Controls[i]).Tag;&lt;br /&gt;
    }&lt;br /&gt;
    lbl.Font = new Font(lbl.Font, fs);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CheckedChanged event for CheckBox==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
   &lt;br /&gt;
class CheckBoxDemo: Form&lt;br /&gt;
{&lt;br /&gt;
     public static void Main()&lt;br /&gt;
     {&lt;br /&gt;
          Application.Run(new CheckBoxDemo());&lt;br /&gt;
     }&lt;br /&gt;
     public CheckBoxDemo()&lt;br /&gt;
     {&lt;br /&gt;
          CheckBox[] achkbox  = new CheckBox[4];&lt;br /&gt;
          int        cyText   = Font.Height;&lt;br /&gt;
          int        cxText   = cyText / 2;&lt;br /&gt;
          string[]   astrText = {&amp;quot;Bold&amp;quot;, &amp;quot;Italic&amp;quot;, &amp;quot;Underline&amp;quot;, &amp;quot;Strikeout&amp;quot;};&lt;br /&gt;
   &lt;br /&gt;
          for (int i = 0; i &amp;lt; 4; i++){&lt;br /&gt;
               achkbox[i] = new CheckBox();&lt;br /&gt;
               achkbox[i].Text = astrText[i];&lt;br /&gt;
               achkbox[i].Location = new Point(2 * cxText, (4 + 3 * i) * cyText / 2);&lt;br /&gt;
               achkbox[i].Size = new Size(12 * cxText, cyText);&lt;br /&gt;
               achkbox[i].CheckedChanged += new EventHandler(CheckBoxOnCheckedChanged);&lt;br /&gt;
          }&lt;br /&gt;
          Controls.AddRange(achkbox);&lt;br /&gt;
     }&lt;br /&gt;
     void CheckBoxOnCheckedChanged(object obj, EventArgs ea)&lt;br /&gt;
     {&lt;br /&gt;
          Invalidate(false);&lt;br /&gt;
     }&lt;br /&gt;
     FontStyle[] afs  = { FontStyle.Bold,FontStyle.Italic, FontStyle.Underline, FontStyle.Strikeout };&lt;br /&gt;
     FontStyle   fs   = 0;     &lt;br /&gt;
     protected override void OnPaint(PaintEventArgs pea)&lt;br /&gt;
     {&lt;br /&gt;
          Graphics    grfx = pea.Graphics;&lt;br /&gt;
          for (int i = 0; i &amp;lt; 4; i++){&lt;br /&gt;
               if (((CheckBox) Controls[i]).Checked){&lt;br /&gt;
                    fs |= afs[i];&lt;br /&gt;
               }&lt;br /&gt;
          }&lt;br /&gt;
          grfx.DrawString(Text, new Font(Font, fs), new SolidBrush(ForeColor), 0, 0);&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>