<?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%2FForm_Properties</id>
		<title>Csharp/CSharp Tutorial/GUI Windows Forms/Form Properties - История изменений</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%2FForm_Properties"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Form_Properties&amp;action=history"/>
		<updated>2026-04-30T01:30:46Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Form_Properties&amp;diff=5371&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/Form_Properties&amp;diff=5371&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/Form_Properties&amp;diff=5372&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/Form_Properties&amp;diff=5372&amp;oldid=prev"/>
				<updated>2010-05-26T12:15:09Z</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;==Center Form to the screen==&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.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 CenterForm : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.ruponentModel.Container components;&lt;br /&gt;
  public CenterForm()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
    CenterToScreen();&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.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(292, 273);&lt;br /&gt;
    this.Text = &amp;quot;DataGridExample&amp;quot;;&lt;br /&gt;
    this.Resize += new System.EventHandler(this.CenterForm_Resize);&lt;br /&gt;
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.CenterForm_Paint);&lt;br /&gt;
    }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new CenterForm());&lt;br /&gt;
  }&lt;br /&gt;
  private void CenterForm_Resize(object sender, System.EventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    Invalidate();&lt;br /&gt;
    Console.WriteLine(&amp;quot;Resize&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  private void CenterForm_Paint(object sender, System.Windows.Forms.PaintEventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.DrawString(&amp;quot;Text&amp;quot;, &lt;br /&gt;
      new Font(&amp;quot;Times New Roman&amp;quot;, 20), &lt;br /&gt;
      new SolidBrush(Color.Black), &lt;br /&gt;
      this.DisplayRectangle);    &lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change Form ClientSize==&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 FormClientSize : Form&lt;br /&gt;
{&lt;br /&gt;
  private Button btnShow;&lt;br /&gt;
  private Button btnChange;&lt;br /&gt;
  private Label lbl;&lt;br /&gt;
  public FormClientSize()&lt;br /&gt;
  {&lt;br /&gt;
    BackColor = Color.LightBlue;&lt;br /&gt;
    ForeColor = Color.DarkBlue;&lt;br /&gt;
    ClientSize = new Size(350,200);&lt;br /&gt;
    Width = 350;&lt;br /&gt;
    Height = 200;&lt;br /&gt;
    btnShow = new Button();&lt;br /&gt;
    btnShow.Location = new Point(50,50);&lt;br /&gt;
    btnShow.Size = new Size(100,23);&lt;br /&gt;
    btnShow.Text = &amp;quot;Show&amp;quot;;&lt;br /&gt;
    btnShow.Click += new System.EventHandler(btnShow_Click);&lt;br /&gt;
    btnShow.Parent = this;&lt;br /&gt;
    btnChange = new Button();&lt;br /&gt;
    btnChange.Location = new Point(200,50);&lt;br /&gt;
    btnChange.Size = new Size(100,23);&lt;br /&gt;
    btnChange.Text = &amp;quot;Change&amp;quot;;&lt;br /&gt;
    btnChange.Click += new System.EventHandler(btnChange_Click);&lt;br /&gt;
    btnChange.Parent = this;&lt;br /&gt;
    lbl = new Label();&lt;br /&gt;
    lbl.Text = &amp;quot;Control Size and Location&amp;quot;;&lt;br /&gt;
    lbl.Size = new Size(400,25);&lt;br /&gt;
    lbl.Parent = this;&lt;br /&gt;
  }&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new FormClientSize());&lt;br /&gt;
  }&lt;br /&gt;
  private void btnShow_Click(object sender, EventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button Bottom:&amp;quot; + btnShow.Bottom.ToString());&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button Top:&amp;quot; + btnShow.Top.ToString() );&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button Left:&amp;quot; + btnShow.Left.ToString() );&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button Right:&amp;quot; + btnShow.Right.ToString() );&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button Location:&amp;quot; + btnShow.Location.ToString() );&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button Width:&amp;quot; + btnShow.Width.ToString() ); &lt;br /&gt;
    Console.WriteLine(&amp;quot;Button Height:&amp;quot; + btnShow.Height.ToString() );&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button Size:&amp;quot; + btnShow.Size.ToString() );&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button ClientSize:&amp;quot; + btnShow.ClientSize.ToString() );&lt;br /&gt;
    Console.WriteLine(&amp;quot;Form Size:&amp;quot; + this.Size.ToString() );&lt;br /&gt;
    Console.WriteLine(&amp;quot;Form ClientSize:&amp;quot; + this.ClientSize.ToString());&lt;br /&gt;
  }&lt;br /&gt;
  private void btnChange_Click(object sender, EventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    this.Size = new Size(800,200);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Form Bounds Setting==&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.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 FormBoundsSetting : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.ruponentModel.Container components = null;&lt;br /&gt;
  public FormBoundsSetting()&lt;br /&gt;
  {&lt;br /&gt;
    Top = 100;&lt;br /&gt;
    Left = 75;&lt;br /&gt;
    Height = 100;&lt;br /&gt;
    Width = 500;&lt;br /&gt;
    MessageBox.Show(Bounds.ToString(), &amp;quot;Current rect&amp;quot;);&lt;br /&gt;
    InitializeComponent();&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.ruponents = new System.ruponentModel.Container();&lt;br /&gt;
    this.Size = new System.Drawing.Size(300,300);&lt;br /&gt;
    this.Text = &amp;quot;Form1&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new FormBoundsSetting());&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Form Opacity setting==&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.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 FormOpacitySetting : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.ruponentModel.Container components = null;&lt;br /&gt;
  public FormOpacitySetting()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
    Opacity = 0.5d;&lt;br /&gt;
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);&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.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(292, 273);&lt;br /&gt;
    this.Text = &amp;quot;Form1&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new FormOpacitySetting());&lt;br /&gt;
  }&lt;br /&gt;
  private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.DrawString(&amp;quot;String...&amp;quot;, new Font(&amp;quot;Times New Roman&amp;quot;, 20), new SolidBrush(Color.Black), 40, 10);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Form.StartPosition==&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.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
   &lt;br /&gt;
class FormProperties&lt;br /&gt;
{&lt;br /&gt;
     public static void Main()&lt;br /&gt;
     {&lt;br /&gt;
          Form form = new Form();&lt;br /&gt;
   &lt;br /&gt;
          form.StartPosition   = FormStartPosition.CenterScreen;&lt;br /&gt;
   &lt;br /&gt;
          Application.Run(form);&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Form with Maximize Box==&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.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class FormSizable : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
    public FormSizable()&lt;br /&gt;
    {&lt;br /&gt;
        this.MaximizeBox = true;&lt;br /&gt;
        this.FormBorderStyle = FormBorderStyle.Sizable;&lt;br /&gt;
    }&lt;br /&gt;
    static void Main()&lt;br /&gt;
    {&lt;br /&gt;
        Application.Run(new FormSizable());&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Form without MinimizeBox and MaximizedBox==&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 FormMoveDemo : Form&lt;br /&gt;
{&lt;br /&gt;
    private bool dragging;&lt;br /&gt;
    private Point pointClicked;&lt;br /&gt;
    public FormMoveDemo()&lt;br /&gt;
    {&lt;br /&gt;
        InitializeComponent();&lt;br /&gt;
    }&lt;br /&gt;
    private void lblDrag_MouseDown(object sender, MouseEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        if (e.Button == MouseButtons.Left)&lt;br /&gt;
        {&lt;br /&gt;
            dragging = true;&lt;br /&gt;
            pointClicked = new Point(e.X, e.Y);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            dragging = false;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    private void lblDrag_MouseMove(object sender, MouseEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        if (dragging){&lt;br /&gt;
            Point pointMoveTo;&lt;br /&gt;
            pointMoveTo = this.PointToScreen(new Point(e.X, e.Y));&lt;br /&gt;
            pointMoveTo.Offset(-pointClicked.X, -pointClicked.Y);&lt;br /&gt;
            this.Location = pointMoveTo;&lt;br /&gt;
        }   &lt;br /&gt;
    }&lt;br /&gt;
    private void lblDrag_MouseUp(object sender, MouseEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        dragging = false;&lt;br /&gt;
    }&lt;br /&gt;
    private void cmdClose_Click(object sender, EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        this.Close();&lt;br /&gt;
    }&lt;br /&gt;
    [STAThread]&lt;br /&gt;
    public static void Main(string[] args)&lt;br /&gt;
    {&lt;br /&gt;
        Application.Run(new FormMoveDemo());&lt;br /&gt;
    }&lt;br /&gt;
    private System.Windows.Forms.Button cmdClose= new System.Windows.Forms.Button();&lt;br /&gt;
    private System.Windows.Forms.Label lblDrag = new System.Windows.Forms.Label();&lt;br /&gt;
    private System.ruponentModel.IContainer components = null;&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
        this.SuspendLayout();&lt;br /&gt;
        // &lt;br /&gt;
        // cmdClose&lt;br /&gt;
        // &lt;br /&gt;
        this.cmdClose.Location = new System.Drawing.Point(102, 215);&lt;br /&gt;
        this.cmdClose.Name = &amp;quot;cmdClose&amp;quot;;&lt;br /&gt;
        this.cmdClose.Size = new System.Drawing.Size(76, 20);&lt;br /&gt;
        this.cmdClose.TabIndex = 5;&lt;br /&gt;
        this.cmdClose.Text = &amp;quot;Close&amp;quot;;&lt;br /&gt;
        this.cmdClose.Click += new System.EventHandler(this.cmdClose_Click);&lt;br /&gt;
        // &lt;br /&gt;
        // lblDrag&lt;br /&gt;
        // &lt;br /&gt;
        this.lblDrag.BackColor = System.Drawing.Color.Navy;&lt;br /&gt;
        this.lblDrag.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;&lt;br /&gt;
        this.lblDrag.Font = new System.Drawing.Font(&amp;quot;Tahoma&amp;quot;, 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));&lt;br /&gt;
        this.lblDrag.ForeColor = System.Drawing.Color.White;&lt;br /&gt;
        this.lblDrag.Location = new System.Drawing.Point(94, 167);&lt;br /&gt;
        this.lblDrag.Name = &amp;quot;lblDrag&amp;quot;;&lt;br /&gt;
        this.lblDrag.Size = new System.Drawing.Size(96, 36);&lt;br /&gt;
        this.lblDrag.TabIndex = 4;&lt;br /&gt;
        this.lblDrag.Text = &amp;quot;Click here to move the form!&amp;quot;;&lt;br /&gt;
        this.lblDrag.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lblDrag_MouseUp);&lt;br /&gt;
        this.lblDrag.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lblDrag_MouseMove);&lt;br /&gt;
        this.lblDrag.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lblDrag_MouseDown);&lt;br /&gt;
        // &lt;br /&gt;
        // FormMoveDemo&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.ControlBox = false;&lt;br /&gt;
        this.Controls.Add(this.cmdClose);&lt;br /&gt;
        this.Controls.Add(this.lblDrag);&lt;br /&gt;
        this.Font = new System.Drawing.Font(&amp;quot;Tahoma&amp;quot;, 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));&lt;br /&gt;
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;&lt;br /&gt;
        this.MaximizeBox = false;&lt;br /&gt;
        this.MinimizeBox = false;&lt;br /&gt;
        this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
   &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resize redraw form: get/set Form style==&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.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 FormStyleResizeRedraw : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.Windows.Forms.Button btnGetStyles;&lt;br /&gt;
  private System.ruponentModel.Container components = null;&lt;br /&gt;
  public FormStyleResizeRedraw()&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;
  }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new FormStyleResizeRedraw());&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(), &amp;quot;Do you have ResizeRedraw?&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set form background color==&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.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 SetBackgroundForm : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.ruponentModel.Container components;&lt;br /&gt;
  public SetBackgroundForm()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
    BackColor = Color.LemonChiffon;&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.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(292, 273);&lt;br /&gt;
    this.Resize += new System.EventHandler(this.SetBackgroundForm_Resize);&lt;br /&gt;
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.SetBackgroundForm_Paint);&lt;br /&gt;
    }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new SetBackgroundForm());&lt;br /&gt;
  }&lt;br /&gt;
  private void SetBackgroundForm_Resize(object sender, System.EventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    Invalidate();&lt;br /&gt;
    Console.WriteLine(&amp;quot;Resize&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  private void SetBackgroundForm_Paint(object sender, System.Windows.Forms.PaintEventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.DrawString(&amp;quot;Text&amp;quot;, &lt;br /&gt;
      new Font(&amp;quot;Times New Roman&amp;quot;, 20), &lt;br /&gt;
      new SolidBrush(Color.Black), &lt;br /&gt;
      this.DisplayRectangle);    &lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set FormBorderStyle==&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.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
   &lt;br /&gt;
class FormProperties&lt;br /&gt;
{&lt;br /&gt;
     public static void Main()&lt;br /&gt;
     {&lt;br /&gt;
          Form form = new Form();&lt;br /&gt;
   &lt;br /&gt;
          form.FormBorderStyle = FormBorderStyle.FixedSingle;&lt;br /&gt;
   &lt;br /&gt;
          Application.Run(form);&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set form caption==&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.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 SetFormCaption : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.ruponentModel.Container components;&lt;br /&gt;
  public SetFormCaption()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
    Text = &amp;quot;www.nfex.ru&amp;quot;;    &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.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(292, 273);&lt;br /&gt;
    this.Text = &amp;quot;DataGridExample&amp;quot;;&lt;br /&gt;
    this.Resize += new System.EventHandler(this.SetFormCaption_Resize);&lt;br /&gt;
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.SetFormCaption_Paint);&lt;br /&gt;
    }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new SetFormCaption());&lt;br /&gt;
  }&lt;br /&gt;
  private void SetFormCaption_Resize(object sender, System.EventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    Invalidate();&lt;br /&gt;
    Console.WriteLine(&amp;quot;Resize&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  private void SetFormCaption_Paint(object sender, System.Windows.Forms.PaintEventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.DrawString(&amp;quot;Text&amp;quot;, &lt;br /&gt;
      new Font(&amp;quot;Times New Roman&amp;quot;, 20), &lt;br /&gt;
      new SolidBrush(Color.Black), &lt;br /&gt;
      this.DisplayRectangle);    &lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set Form Height==&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.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
   &lt;br /&gt;
class FormProperties&lt;br /&gt;
{&lt;br /&gt;
     public static void Main()&lt;br /&gt;
     {&lt;br /&gt;
          Form form = new Form();&lt;br /&gt;
   &lt;br /&gt;
          form.Height         /= 2;&lt;br /&gt;
   &lt;br /&gt;
          Application.Run(form);&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set Form size==&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.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 SetFormSize : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.ruponentModel.Container components;&lt;br /&gt;
  public SetFormSize()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
    Size = new Size(200, 200);&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.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(292, 273);&lt;br /&gt;
    this.Resize += new System.EventHandler(this.SetFormSize_Resize);&lt;br /&gt;
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.SetFormSize_Paint);&lt;br /&gt;
    }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new SetFormSize());&lt;br /&gt;
  }&lt;br /&gt;
  private void SetFormSize_Resize(object sender, System.EventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    Invalidate();&lt;br /&gt;
    Console.WriteLine(&amp;quot;Resize&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  private void SetFormSize_Paint(object sender, System.Windows.Forms.PaintEventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    Graphics g = e.Graphics;&lt;br /&gt;
    g.DrawString(&amp;quot;Text&amp;quot;, &lt;br /&gt;
      new Font(&amp;quot;Times New Roman&amp;quot;, 20), &lt;br /&gt;
      new SolidBrush(Color.Black), &lt;br /&gt;
      this.DisplayRectangle);    &lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set Form Width==&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.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
   &lt;br /&gt;
class FormProperties&lt;br /&gt;
{&lt;br /&gt;
     public static void Main()&lt;br /&gt;
     {&lt;br /&gt;
          Form form = new Form();&lt;br /&gt;
   &lt;br /&gt;
          form.Width          *= 2;&lt;br /&gt;
   &lt;br /&gt;
          Application.Run(form);&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Form.DialogResult==&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 SimpleDialog: Form&lt;br /&gt;
{&lt;br /&gt;
     public static void Main()&lt;br /&gt;
     {&lt;br /&gt;
          Application.Run(new SimpleDialog());&lt;br /&gt;
     }&lt;br /&gt;
     public SimpleDialog()&lt;br /&gt;
     {&lt;br /&gt;
   &lt;br /&gt;
          Menu = new MainMenu();&lt;br /&gt;
          Menu.MenuItems.Add(&amp;quot;&amp;amp;Dialog!&amp;quot;, new EventHandler(MenuOnClick));&lt;br /&gt;
     }&lt;br /&gt;
     void MenuOnClick(object obj, EventArgs ea)&lt;br /&gt;
     {&lt;br /&gt;
          SimpleDialogBox dlg = new SimpleDialogBox();&lt;br /&gt;
   &lt;br /&gt;
          dlg.ShowDialog();&lt;br /&gt;
   &lt;br /&gt;
          Console.WriteLine(dlg.DialogResult);&lt;br /&gt;
          &lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
class SimpleDialogBox: Form&lt;br /&gt;
{&lt;br /&gt;
     public SimpleDialogBox()&lt;br /&gt;
     {&lt;br /&gt;
          Text = &amp;quot;Simple Dialog Box&amp;quot;;&lt;br /&gt;
   &lt;br /&gt;
          FormBorderStyle = FormBorderStyle.FixedDialog;&lt;br /&gt;
          ControlBox      = false;&lt;br /&gt;
          MaximizeBox     = false;&lt;br /&gt;
          MinimizeBox     = false;&lt;br /&gt;
          ShowInTaskbar   = false;&lt;br /&gt;
   &lt;br /&gt;
          Button btn = new Button();&lt;br /&gt;
          btn.Parent   = this;&lt;br /&gt;
          btn.Text     = &amp;quot;OK&amp;quot;;&lt;br /&gt;
          btn.Location = new Point(50, 50);&lt;br /&gt;
          btn.Size     = new Size (10 * Font.Height, 2 * Font.Height);&lt;br /&gt;
          btn.Click   += new EventHandler(ButtonOkOnClick);&lt;br /&gt;
   &lt;br /&gt;
          btn = new Button();&lt;br /&gt;
          btn.Parent   = this;&lt;br /&gt;
          btn.Text     = &amp;quot;Cancel&amp;quot;;&lt;br /&gt;
          btn.Location = new Point(50, 100);&lt;br /&gt;
          btn.Size     = new Size (10 * Font.Height, 2 * Font.Height);&lt;br /&gt;
          btn.Click   += new EventHandler(ButtonCancelOnClick);&lt;br /&gt;
     }&lt;br /&gt;
     void ButtonOkOnClick(object obj, EventArgs ea)&lt;br /&gt;
     {&lt;br /&gt;
          DialogResult = DialogResult.OK;&lt;br /&gt;
     }&lt;br /&gt;
     void ButtonCancelOnClick(object obj, EventArgs ea)&lt;br /&gt;
     {&lt;br /&gt;
          DialogResult = DialogResult.Cancel;&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>