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

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Custom_Control&amp;diff=5327&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/Custom_Control&amp;diff=5327&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/Custom_Control&amp;diff=5328&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/Custom_Control&amp;diff=5328&amp;oldid=prev"/>
				<updated>2010-05-26T12:14:54Z</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;==Create control==&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 UserControlForm : System.Windows.Forms.Form&lt;br /&gt;
  {&lt;br /&gt;
    private UserControlExample userControlExample1;&lt;br /&gt;
    private System.ruponentModel.Container components = null;&lt;br /&gt;
    public UserControlForm()&lt;br /&gt;
    {&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.userControlExample1 = new UserControlExample();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      this.userControlExample1.Current = 5;&lt;br /&gt;
      this.userControlExample1.Location = new System.Drawing.Point(98, 113);&lt;br /&gt;
      this.userControlExample1.Max = 10;&lt;br /&gt;
      this.userControlExample1.Min = 0;&lt;br /&gt;
      this.userControlExample1.Name = &amp;quot;userControlExample1&amp;quot;;&lt;br /&gt;
      this.userControlExample1.Size = new System.Drawing.Size(96, 40);&lt;br /&gt;
      this.userControlExample1.TabIndex = 0;&lt;br /&gt;
      // &lt;br /&gt;
      // UserControlForm&lt;br /&gt;
      // &lt;br /&gt;
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
      this.ClientSize = new System.Drawing.Size(292, 266);&lt;br /&gt;
      this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                      this.userControlExample1});&lt;br /&gt;
      this.Name = &amp;quot;UserControlForm&amp;quot;;&lt;br /&gt;
      this.Text = &amp;quot;UserControlForm&amp;quot;;&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    static void Main() &lt;br /&gt;
    {&lt;br /&gt;
      Application.Run(new UserControlForm());&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public class UserControlExample : System.Windows.Forms.UserControl&lt;br /&gt;
  {&lt;br /&gt;
    private System.Windows.Forms.TextBox textBox1;&lt;br /&gt;
    private System.Windows.Forms.VScrollBar vScrollBar1;&lt;br /&gt;
    private System.ruponentModel.Container components = null;&lt;br /&gt;
    public UserControlExample()&lt;br /&gt;
    {&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;
          components.Dispose();&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.textBox1 = new System.Windows.Forms.TextBox();&lt;br /&gt;
      this.vScrollBar1 = new System.Windows.Forms.VScrollBar();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      this.textBox1.Location = new System.Drawing.Point(8, 8);&lt;br /&gt;
      this.textBox1.Name = &amp;quot;textBox1&amp;quot;;&lt;br /&gt;
      this.textBox1.ReadOnly = true;&lt;br /&gt;
      this.textBox1.Size = new System.Drawing.Size(48, 20);&lt;br /&gt;
      this.textBox1.TabIndex = 0;&lt;br /&gt;
      this.textBox1.Text = &amp;quot;&amp;quot;;&lt;br /&gt;
      this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;&lt;br /&gt;
      this.vScrollBar1.Location = new System.Drawing.Point(64, 8);&lt;br /&gt;
      this.vScrollBar1.Name = &amp;quot;vScrollBar1&amp;quot;;&lt;br /&gt;
      this.vScrollBar1.Size = new System.Drawing.Size(17, 24);&lt;br /&gt;
      this.vScrollBar1.TabIndex = 1;&lt;br /&gt;
      this.vScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.vScrollBar1_Scroll);&lt;br /&gt;
      this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                      this.vScrollBar1,&lt;br /&gt;
                                      this.textBox1});&lt;br /&gt;
      this.Name = &amp;quot;UserControlExample&amp;quot;;&lt;br /&gt;
      this.Size = new System.Drawing.Size(96, 40);&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    private int m_min = int.MinValue;&lt;br /&gt;
    private int m_max = int.MaxValue;&lt;br /&gt;
    private int m_current = 0;&lt;br /&gt;
    private void vScrollBar1_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      if ( e.Type == ScrollEventType.SmallIncrement )&lt;br /&gt;
      {&lt;br /&gt;
        try&lt;br /&gt;
        {&lt;br /&gt;
          Current -= 1;&lt;br /&gt;
        }&lt;br /&gt;
        catch&lt;br /&gt;
        {&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      else&lt;br /&gt;
      {&lt;br /&gt;
        if ( e.Type == ScrollEventType.SmallDecrement )&lt;br /&gt;
        {&lt;br /&gt;
          try&lt;br /&gt;
          {&lt;br /&gt;
            Current += 1;&lt;br /&gt;
          }&lt;br /&gt;
          catch&lt;br /&gt;
          {&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      vScrollBar1.Value = 50;&lt;br /&gt;
    }&lt;br /&gt;
    public int Min&lt;br /&gt;
    {&lt;br /&gt;
      get&lt;br /&gt;
      {&lt;br /&gt;
        return m_min;&lt;br /&gt;
      }&lt;br /&gt;
      set&lt;br /&gt;
      {&lt;br /&gt;
        m_min = value;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    public int Max&lt;br /&gt;
    {&lt;br /&gt;
      get&lt;br /&gt;
      {&lt;br /&gt;
        return m_max;&lt;br /&gt;
      }&lt;br /&gt;
      set&lt;br /&gt;
      {&lt;br /&gt;
        m_max = value;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    public int Current&lt;br /&gt;
    {&lt;br /&gt;
      get&lt;br /&gt;
      {&lt;br /&gt;
        return m_current;&lt;br /&gt;
      }&lt;br /&gt;
      set&lt;br /&gt;
      {&lt;br /&gt;
        if ( ( value &amp;gt; m_max ) || ( value &amp;lt; m_min ) )&lt;br /&gt;
        {&lt;br /&gt;
          throw new ArgumentOutOfRangeException( &amp;quot;Current&amp;quot; );&lt;br /&gt;
        }&lt;br /&gt;
        m_current = value;&lt;br /&gt;
        textBox1.Text = m_current.ToString();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Create your own component by subclassing System.ComponentModel.Component==&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.ruponentModel;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.Diagnostics;&lt;br /&gt;
public class MyComponent : System.ruponentModel.ruponent&lt;br /&gt;
{&lt;br /&gt;
  private System.ruponentModel.Container components = null;&lt;br /&gt;
  public MyComponent(System.ruponentModel.IContainer container)&lt;br /&gt;
  {&lt;br /&gt;
    container.Add(this);&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
  }&lt;br /&gt;
  public MyComponent()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
  }&lt;br /&gt;
  private void InitializeComponent()&lt;br /&gt;
  {&lt;br /&gt;
    components = new System.ruponentModel.Container();&lt;br /&gt;
  }&lt;br /&gt;
  protected string m_message;&lt;br /&gt;
  public string Message&lt;br /&gt;
  {&lt;br /&gt;
    get&lt;br /&gt;
    {&lt;br /&gt;
      return m_message;&lt;br /&gt;
    }&lt;br /&gt;
    set&lt;br /&gt;
    {&lt;br /&gt;
      m_message = value;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The clock control==&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.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
&lt;br /&gt;
public class DigitalClock : System.Windows.Forms.UserControl {&lt;br /&gt;
    private System.Windows.Forms.Timer timer1;&lt;br /&gt;
    private System.ruponentModel.IContainer components;&lt;br /&gt;
    public DigitalClock() {&lt;br /&gt;
        this.ruponents = new System.ruponentModel.Container();&lt;br /&gt;
        this.timer1 = new System.Windows.Forms.Timer(this.ruponents);&lt;br /&gt;
        this.timer1.Enabled = true;&lt;br /&gt;
        this.timer1.Interval = 1000;&lt;br /&gt;
        this.timer1.Tick += new System.EventHandler(this.OnTick);&lt;br /&gt;
        this.Paint += new System.Windows.Forms.PaintEventHandler(this.OnPaint);&lt;br /&gt;
    }&lt;br /&gt;
    private void OnPaint(object sender,  System.Windows.Forms.PaintEventArgs e) {&lt;br /&gt;
        System.DateTime dt = System.DateTime.Now;&lt;br /&gt;
        String Text = dt.ToLongTimeString();&lt;br /&gt;
        e.Graphics.DrawString(Text, Font, new SolidBrush(ForeColor),ClientRectangle);&lt;br /&gt;
    }&lt;br /&gt;
    private void OnTick(object sender, System.EventArgs e) {&lt;br /&gt;
        this.Refresh();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class Form1 : System.Windows.Forms.Form {&lt;br /&gt;
    private System.Windows.Forms.Label label1;&lt;br /&gt;
    private DigitalClock clock= new DigitalClock();&lt;br /&gt;
    public Form1() {&lt;br /&gt;
        this.label1 = new System.Windows.Forms.Label();&lt;br /&gt;
        this.SuspendLayout();&lt;br /&gt;
        this.label1.Location = new System.Drawing.Point(16, 24);&lt;br /&gt;
        this.label1.Size = new System.Drawing.Size(128, 16);&lt;br /&gt;
        this.label1.Text = &amp;quot;Clock:&amp;quot;;&lt;br /&gt;
        this.clock.Location = new System.Drawing.Point(16, 50);&lt;br /&gt;
        this.clock.Size = new System.Drawing.Size(128, 80);&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.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
              this.label1,&lt;br /&gt;
              this.clock});&lt;br /&gt;
        this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    [STAThread]&lt;br /&gt;
    static void Main() {&lt;br /&gt;
        Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>