<?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%2FScrollBar</id>
		<title>Csharp/C Sharp/GUI Windows Form/ScrollBar - История изменений</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%2FScrollBar"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/ScrollBar&amp;action=history"/>
		<updated>2026-04-29T19:06:00Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/ScrollBar&amp;diff=72&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/ScrollBar&amp;diff=72&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/ScrollBar&amp;diff=73&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/ScrollBar&amp;diff=73&amp;oldid=prev"/>
				<updated>2010-05-26T11:32:53Z</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;==ScrollBars Demo ==&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;
/*&lt;br /&gt;
Professional Windows GUI Programming Using C#&lt;br /&gt;
by Jay Glynn, Csaba Torok, Richard Conway, Wahid Choudhury, &lt;br /&gt;
   Zach Greenvoss, Shripad Kulkarni, Neil Whitlow&lt;br /&gt;
Publisher: Peer Information&lt;br /&gt;
ISBN: 1861007663&lt;br /&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;
namespace ScrollBars&lt;br /&gt;
{&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Summary description for ScrollBars.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public class ScrollBars : System.Windows.Forms.Form&lt;br /&gt;
    {&lt;br /&gt;
        private System.Windows.Forms.TextBox textBox1;&lt;br /&gt;
        private System.Windows.Forms.VScrollBar vScrollBar1;&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// Required designer variable.&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        int counter=0;&lt;br /&gt;
        private System.Windows.Forms.Label label1;&lt;br /&gt;
        private System.ruponentModel.Container components = null;&lt;br /&gt;
        public ScrollBars()&lt;br /&gt;
        {&lt;br /&gt;
            //&lt;br /&gt;
            // Required for Windows Form Designer support&lt;br /&gt;
            //&lt;br /&gt;
            InitializeComponent();&lt;br /&gt;
            //&lt;br /&gt;
            // TODO: Add any constructor code after InitializeComponent call&lt;br /&gt;
            //&lt;br /&gt;
        }&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// Clean up any resources being used.&lt;br /&gt;
        /// &amp;lt;/summary&amp;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;
        #region Windows Form Designer generated code&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// Required method for Designer support - do not modify&lt;br /&gt;
        /// the contents of this method with the code editor.&lt;br /&gt;
        /// &amp;lt;/summary&amp;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.label1 = new System.Windows.Forms.Label();&lt;br /&gt;
            this.SuspendLayout();&lt;br /&gt;
            // &lt;br /&gt;
            // textBox1&lt;br /&gt;
            // &lt;br /&gt;
            this.textBox1.Font = new System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));&lt;br /&gt;
            this.textBox1.ForeColor = System.Drawing.Color.Transparent;&lt;br /&gt;
            this.textBox1.Location = new System.Drawing.Point(24, 56);&lt;br /&gt;
            this.textBox1.Multiline = true;&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(144, 32);&lt;br /&gt;
            this.textBox1.TabIndex = 4;&lt;br /&gt;
            this.textBox1.Text = &amp;quot;&amp;quot;;&lt;br /&gt;
            this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;&lt;br /&gt;
            // &lt;br /&gt;
            // vScrollBar1&lt;br /&gt;
            // &lt;br /&gt;
            this.vScrollBar1.Location = new System.Drawing.Point(168, 56);&lt;br /&gt;
            this.vScrollBar1.Name = &amp;quot;vScrollBar1&amp;quot;;&lt;br /&gt;
            this.vScrollBar1.Size = new System.Drawing.Size(16, 32);&lt;br /&gt;
            this.vScrollBar1.TabIndex = 7;&lt;br /&gt;
            this.vScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.vScrollBar1_Scroll);&lt;br /&gt;
            // &lt;br /&gt;
            // label1&lt;br /&gt;
            // &lt;br /&gt;
            this.label1.Location = new System.Drawing.Point(8, 16);&lt;br /&gt;
            this.label1.Name = &amp;quot;label1&amp;quot;;&lt;br /&gt;
            this.label1.Size = new System.Drawing.Size(192, 16);&lt;br /&gt;
            this.label1.TabIndex = 6;&lt;br /&gt;
            this.label1.Text = &amp;quot;Numeric Scolling using VScroll Bars&amp;quot;;&lt;br /&gt;
            // &lt;br /&gt;
            // ScrollBars&lt;br /&gt;
            // &lt;br /&gt;
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
            this.ClientSize = new System.Drawing.Size(208, 109);&lt;br /&gt;
            this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                                                          this.label1,&lt;br /&gt;
                                                                          this.vScrollBar1,&lt;br /&gt;
                                                                          this.textBox1});&lt;br /&gt;
            this.Name = &amp;quot;ScrollBars&amp;quot;;&lt;br /&gt;
            this.Text = &amp;quot;Numeric Scroll&amp;quot;;&lt;br /&gt;
            this.Load += new System.EventHandler(this.ScrollBars_Load);&lt;br /&gt;
            this.ResumeLayout(false);&lt;br /&gt;
        }&lt;br /&gt;
        #endregion&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// The main entry point for the application.&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        [STAThread]&lt;br /&gt;
        static void Main() &lt;br /&gt;
        {&lt;br /&gt;
            Application.Run(new ScrollBars());&lt;br /&gt;
        }&lt;br /&gt;
        private void textBox1_TextChanged(object sender, System.EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
        }&lt;br /&gt;
        private void ScrollBars_Load(object sender, System.EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            // Set the maximum range for the scrollbar&lt;br /&gt;
            vScrollBar1.Maximum = 100;&lt;br /&gt;
            // Set the minimum range for the scrollbar&lt;br /&gt;
            vScrollBar1.Minimum = 0 ; &lt;br /&gt;
            // Set the SmallChange factor&lt;br /&gt;
            vScrollBar1.SmallChange = 1;    &lt;br /&gt;
        }&lt;br /&gt;
        private void vScrollBar1_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            // Check if the increment is Small &lt;br /&gt;
         if ( e.Type == ScrollEventType.Last ) &lt;br /&gt;
            counter = 100  ; &lt;br /&gt;
         else&lt;br /&gt;
            // Check if the scroll is moved to minimum pos&lt;br /&gt;
            if ( e.Type == ScrollEventType.First) &lt;br /&gt;
            counter = 0  ; &lt;br /&gt;
         else&lt;br /&gt;
            // Check if the scroll is moved small distance&lt;br /&gt;
            if ( e.Type == ScrollEventType.SmallDecrement ) &lt;br /&gt;
            counter -- ; &lt;br /&gt;
         else&lt;br /&gt;
            // Check if the scroll is moved small distance&lt;br /&gt;
            if ( e.Type == ScrollEventType.SmallIncrement )&lt;br /&gt;
         {&lt;br /&gt;
            counter++;&lt;br /&gt;
            MessageBox.Show(&amp;quot;Small increment&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
            // Check if the scroll is moved large distance&lt;br /&gt;
            if ( e.Type == ScrollEventType.LargeDecrement ) &lt;br /&gt;
            counter-=5;&lt;br /&gt;
         else&lt;br /&gt;
            // Check if the scroll is moved large distance&lt;br /&gt;
            if ( e.Type == ScrollEventType.LargeIncrement )&lt;br /&gt;
         {&lt;br /&gt;
            MessageBox.Show(&amp;quot;Large increment&amp;quot;);&lt;br /&gt;
            counter+=5;&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
            // Check if the scroll is moved to the Min position&lt;br /&gt;
            if ( e.Type == ScrollEventType.First ) &lt;br /&gt;
            counter = 0 ; &lt;br /&gt;
         else&lt;br /&gt;
            // Check if the scroll to the Max position&lt;br /&gt;
            if ( e.Type == ScrollEventType.Last) &lt;br /&gt;
            counter = 100  ; &lt;br /&gt;
        Console.WriteLine(e.NewValue+&amp;quot;\n&amp;quot;);&lt;br /&gt;
        // Check if the scroll is moved large distance&lt;br /&gt;
            if ( counter &amp;gt; 100 ) counter = 100 ; &lt;br /&gt;
            if ( counter &amp;lt; 0 ) counter = 0 ;&lt;br /&gt;
            textBox1.Text = counter.ToString() ;&lt;br /&gt;
        }&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;
==Scroll event==&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;
    private System.Windows.Forms.TextBox textBox1;&lt;br /&gt;
    private System.Windows.Forms.VScrollBar vScrollBar1;&lt;br /&gt;
    int counter = 0;&lt;br /&gt;
    private System.Windows.Forms.Label label1;&lt;br /&gt;
    public Form1() {&lt;br /&gt;
        this.textBox1 = new System.Windows.Forms.TextBox();&lt;br /&gt;
        this.vScrollBar1 = new System.Windows.Forms.VScrollBar();&lt;br /&gt;
        this.label1 = new System.Windows.Forms.Label();&lt;br /&gt;
        this.SuspendLayout();&lt;br /&gt;
        this.textBox1.Font = new System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));&lt;br /&gt;
        this.textBox1.ForeColor = System.Drawing.Color.Transparent;&lt;br /&gt;
        this.textBox1.Location = new System.Drawing.Point(24, 56);&lt;br /&gt;
        this.textBox1.Multiline = true;&lt;br /&gt;
        this.textBox1.ReadOnly = true;&lt;br /&gt;
        this.textBox1.Size = new System.Drawing.Size(144, 32);&lt;br /&gt;
        this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;&lt;br /&gt;
        this.vScrollBar1.Location = new System.Drawing.Point(168, 56);&lt;br /&gt;
        this.vScrollBar1.Size = new System.Drawing.Size(16, 32);&lt;br /&gt;
        this.vScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.vScrollBar1_Scroll);&lt;br /&gt;
        this.label1.Location = new System.Drawing.Point(8, 16);&lt;br /&gt;
        this.label1.Size = new System.Drawing.Size(192, 16);&lt;br /&gt;
        this.label1.Text = &amp;quot;Numeric Scolling using VScroll Bars&amp;quot;;&lt;br /&gt;
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
        this.ClientSize = new System.Drawing.Size(208, 109);&lt;br /&gt;
        this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                      this.label1,&lt;br /&gt;
                                      this.vScrollBar1,&lt;br /&gt;
                                      this.textBox1});&lt;br /&gt;
        this.Text = &amp;quot;Numeric Scroll&amp;quot;;&lt;br /&gt;
        this.Load += new System.EventHandler(this.Form1_Load);&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;
    private void textBox1_TextChanged(object sender, System.EventArgs e) {&lt;br /&gt;
    }&lt;br /&gt;
    private void Form1_Load(object sender, System.EventArgs e) {&lt;br /&gt;
        vScrollBar1.Maximum = 100;&lt;br /&gt;
        vScrollBar1.Minimum = 0;&lt;br /&gt;
        vScrollBar1.SmallChange = 1;&lt;br /&gt;
    }&lt;br /&gt;
    private void vScrollBar1_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e) {&lt;br /&gt;
        if (e.Type == ScrollEventType.Last)&lt;br /&gt;
            counter = 100;&lt;br /&gt;
        if (e.Type == ScrollEventType.First)&lt;br /&gt;
            counter = 0;&lt;br /&gt;
        if (e.Type == ScrollEventType.SmallDecrement)&lt;br /&gt;
            counter--;&lt;br /&gt;
        if (e.Type == ScrollEventType.SmallIncrement) {&lt;br /&gt;
            counter++;&lt;br /&gt;
        } &lt;br /&gt;
        if (e.Type == ScrollEventType.LargeDecrement)&lt;br /&gt;
            counter -= 5;&lt;br /&gt;
        if (e.Type == ScrollEventType.LargeIncrement) {&lt;br /&gt;
            counter += 5;&lt;br /&gt;
        } &lt;br /&gt;
        if (e.Type == ScrollEventType.First)&lt;br /&gt;
            counter = 0;&lt;br /&gt;
        if (e.Type == ScrollEventType.Last)&lt;br /&gt;
            counter = 100;&lt;br /&gt;
        Console.WriteLine(e.NewValue + &amp;quot;\n&amp;quot;);&lt;br /&gt;
        if (counter &amp;gt; 100) counter = 100;&lt;br /&gt;
        if (counter &amp;lt; 0) counter = 0;&lt;br /&gt;
        Console.WriteLine(counter.ToString());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Use ScrollBar to control the picture size==&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;
public class Sizer : System.Windows.Forms.Form {&lt;br /&gt;
    private System.Windows.Forms.PictureBox picCritter;&lt;br /&gt;
    private System.Windows.Forms.HScrollBar scrSize;&lt;br /&gt;
    &lt;br /&gt;
    public static void Main(){&lt;br /&gt;
        Application.Run(new Sizer());&lt;br /&gt;
    } &lt;br /&gt;
    public Sizer() {&lt;br /&gt;
        InitializeComponent();&lt;br /&gt;
    }&lt;br /&gt;
    private void InitializeComponent() {&lt;br /&gt;
      this.picCritter = new System.Windows.Forms.PictureBox();&lt;br /&gt;
      this.scrSize = new System.Windows.Forms.HScrollBar();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      this.picCritter.BackColor = System.Drawing.Color.White;&lt;br /&gt;
      this.picCritter.Image = new Bitmap(&amp;quot;winter.jpg&amp;quot;);&lt;br /&gt;
      this.picCritter.Location = new System.Drawing.Point(8, 8);&lt;br /&gt;
      this.picCritter.Name = &amp;quot;picCritter&amp;quot;;&lt;br /&gt;
      this.picCritter.Size = new System.Drawing.Size(40, 40);&lt;br /&gt;
      this.picCritter.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;&lt;br /&gt;
      this.picCritter.TabIndex = 0;&lt;br /&gt;
      this.picCritter.TabStop = false;&lt;br /&gt;
      this.scrSize.Location = new System.Drawing.Point(16, 248);&lt;br /&gt;
      this.scrSize.Maximum = 200;&lt;br /&gt;
      this.scrSize.Minimum = 50;&lt;br /&gt;
      this.scrSize.Name = &amp;quot;scrSize&amp;quot;;&lt;br /&gt;
      this.scrSize.Size = new System.Drawing.Size(256, 16);&lt;br /&gt;
      this.scrSize.TabIndex = 1;&lt;br /&gt;
      this.scrSize.Value = 50;&lt;br /&gt;
      this.scrSize.Scroll += new System.Windows.Forms.ScrollEventHandler(this.scrSize_Scroll);&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[] {this.scrSize,&lt;br /&gt;
                                                                  this.picCritter});&lt;br /&gt;
      this.Name = &amp;quot;Sizer&amp;quot;;&lt;br /&gt;
      this.Text = &amp;quot;Sizer&amp;quot;;&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
  }&lt;br /&gt;
  private void scrSize_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e) {&lt;br /&gt;
      picCritter.Size = new Size(scrSize.Value, scrSize.Value);&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;
==VScrollBar ValueChanged==&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 ColorScroll: Form&lt;br /&gt;
{&lt;br /&gt;
     Panel        panel;&lt;br /&gt;
     Label[]      alabelName  = new Label[3];&lt;br /&gt;
     Label[]      alabelValue = new Label[3];&lt;br /&gt;
     VScrollBar[] avscroll    = new VScrollBar[3];&lt;br /&gt;
   &lt;br /&gt;
     public static void Main()&lt;br /&gt;
     {&lt;br /&gt;
          Application.Run(new ColorScroll());&lt;br /&gt;
     }&lt;br /&gt;
     public ColorScroll()&lt;br /&gt;
     {&lt;br /&gt;
          Color[] acolor = { Color.Red, Color.Green, Color.Blue };&lt;br /&gt;
  &lt;br /&gt;
          panel = new Panel();&lt;br /&gt;
          panel.Parent = this;&lt;br /&gt;
          panel.Location = new Point(0, 0);&lt;br /&gt;
          panel.BackColor = Color.White;&lt;br /&gt;
   &lt;br /&gt;
          for (int i = 0; i &amp;lt; 3; i++)&lt;br /&gt;
          {&lt;br /&gt;
               alabelName[i] = new Label();&lt;br /&gt;
               alabelName[i].Parent = panel;&lt;br /&gt;
               alabelName[i].ForeColor = acolor[i];&lt;br /&gt;
               alabelName[i].Text = &amp;quot;&amp;amp;&amp;quot; + acolor[i].ToKnownColor();&lt;br /&gt;
               alabelName[i].TextAlign = ContentAlignment.MiddleCenter;&lt;br /&gt;
   &lt;br /&gt;
               avscroll[i] = new VScrollBar();&lt;br /&gt;
               avscroll[i].Parent = panel;&lt;br /&gt;
               avscroll[i].SmallChange = 1;&lt;br /&gt;
               avscroll[i].LargeChange = 16;&lt;br /&gt;
               avscroll[i].Minimum  = 0;&lt;br /&gt;
               avscroll[i].Maximum = 255 + avscroll[i].LargeChange - 1;&lt;br /&gt;
               avscroll[i].ValueChanged += new EventHandler(ScrollOnValueChanged);&lt;br /&gt;
               avscroll[i].TabStop = true;&lt;br /&gt;
   &lt;br /&gt;
               alabelValue[i] = new Label();&lt;br /&gt;
               alabelValue[i].Parent = panel;&lt;br /&gt;
               alabelValue[i].TextAlign = ContentAlignment.MiddleCenter;&lt;br /&gt;
          }&lt;br /&gt;
          Color color = BackColor;&lt;br /&gt;
          avscroll[0].Value = color.R;  // Generates ValueChanged event&lt;br /&gt;
          avscroll[1].Value = color.G;&lt;br /&gt;
          avscroll[2].Value = color.B;&lt;br /&gt;
   &lt;br /&gt;
          OnResize(EventArgs.Empty);&lt;br /&gt;
     }&lt;br /&gt;
     protected override void OnResize(EventArgs ea)&lt;br /&gt;
     {&lt;br /&gt;
          base.OnResize(ea);&lt;br /&gt;
   &lt;br /&gt;
          int cx = ClientSize.Width;&lt;br /&gt;
          int cy = ClientSize.Height;&lt;br /&gt;
          int cyFont = Font.Height;&lt;br /&gt;
   &lt;br /&gt;
          panel.Size = new Size(cx / 2, cy);&lt;br /&gt;
   &lt;br /&gt;
          for (int i = 0; i &amp;lt; 3; i++)&lt;br /&gt;
          {&lt;br /&gt;
               alabelName[i].Location = new Point(i * cx / 6, cyFont / 2);&lt;br /&gt;
               alabelName[i].Size = new Size(cx / 6, cyFont);&lt;br /&gt;
   &lt;br /&gt;
               avscroll[i].Location = new Point((4 * i + 1) * cx / 24,&lt;br /&gt;
                                                2 * cyFont);&lt;br /&gt;
               avscroll[i].Size = new Size(cx / 12, cy - 4 * cyFont);&lt;br /&gt;
   &lt;br /&gt;
               alabelValue[i].Location = new Point(i * cx / 6,&lt;br /&gt;
                                                   cy - 3 * cyFont / 2);&lt;br /&gt;
               alabelValue[i].Size = new Size(cx / 6, cyFont);&lt;br /&gt;
          }&lt;br /&gt;
     }&lt;br /&gt;
     void ScrollOnValueChanged(Object obj, EventArgs ea)&lt;br /&gt;
     {&lt;br /&gt;
          for (int i = 0; i &amp;lt; 3; i++)&lt;br /&gt;
               if((VScrollBar) obj == avscroll[i])&lt;br /&gt;
                    alabelValue[i].Text = avscroll[i].Value.ToString();&lt;br /&gt;
   &lt;br /&gt;
          BackColor = Color.FromArgb(avscroll[0].Value, &lt;br /&gt;
                                     avscroll[1].Value,&lt;br /&gt;
                                     avscroll[2].Value);&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>