Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

A custom range selector control in C# (with a little animating slider)

, 20 Aug 2008
At times, business needs are so unique that we have to write new controls in addition to the existing Toolbox provided controls. This article explains how to write such a unique control, named Range Control. Control source and a sample app are included.
Binaries.zip
Binaries
arrow.JPG
arrowleft.JPG
TestApplication.exe
TestControl.dll
BinariesVer1.5.zip
arrow.JPG
arrowleft.JPG
TestApplication.exe
TestControl.dll
TestControl.zip
TestControl
bin
Release
arrow.JPG
arrowleft.JPG
TestControl.dll
Copy of RangeIcon.bmp
RangeIcon.ico
RangeScale.bmp
Thumb.bmp
Thumbs.key
TestApplication
App.ico
bin
Release
arrow.JPG
arrowleft.JPG
TestApplication.exe
TestApplication.vshost.exe
TestControl.dll
RangeIcon.ico
TestControl1.5.zip
arrow.JPG
arrowleft.JPG
TestControl.dll
Copy of RangeIcon.bmp
RangeIcon.ico
RangeScale.bmp
Thumb.bmp
Thumbs.key
App.ico
arrow.JPG
arrowleft.JPG
TestApplication.exe
TestApplication.vshost.exe
TestControl.dll
RangeIcon.ico
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace TestApplication
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class TestApp : System.Windows.Forms.Form
	{
		//private TestControl.UserControl1 userControl11;
		private System.Windows.Forms.Button button1;
        private System.Windows.Forms.TextBox textBox1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.TextBox textBox2;
		private string strRangeString;
        private CustomRangeSelectorControl.NotifyClient objNotifyClient;
        private CustomRangeSelectorControl.RangeSelectorControl rangeSelectorControl1;
        private System.Timers.Timer timer1;
        private GroupBox groupBox1;
        private Label label1;
        private GroupBox groupBox2;
        private CustomRangeSelectorControl.RangeSelectorControl rangeSelectorControl2;
        private GroupBox groupBox3;
        private CustomRangeSelectorControl.RangeSelectorControl rangeSelectorControl3;
        private GroupBox groupBox4;
        private CustomRangeSelectorControl.RangeSelectorControl rangeSelectorControl4;
        private GroupBox groupBox5;
        private GroupBox groupBox6;
        private CustomRangeSelectorControl.RangeSelectorControl rangeSelectorControl5;
        private CustomRangeSelectorControl.RangeSelectorControl rangeSelectorControl6;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public TestApp()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.button1 = new System.Windows.Forms.Button();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.timer1 = new System.Timers.Timer();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.label1 = new System.Windows.Forms.Label();
            this.rangeSelectorControl1 = new CustomRangeSelectorControl.RangeSelectorControl();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.rangeSelectorControl2 = new CustomRangeSelectorControl.RangeSelectorControl();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.rangeSelectorControl3 = new CustomRangeSelectorControl.RangeSelectorControl();
            this.groupBox4 = new System.Windows.Forms.GroupBox();
            this.rangeSelectorControl4 = new CustomRangeSelectorControl.RangeSelectorControl();
            this.groupBox5 = new System.Windows.Forms.GroupBox();
            this.rangeSelectorControl5 = new CustomRangeSelectorControl.RangeSelectorControl();
            this.groupBox6 = new System.Windows.Forms.GroupBox();
            this.rangeSelectorControl6 = new CustomRangeSelectorControl.RangeSelectorControl();
            ((System.ComponentModel.ISupportInitialize)(this.timer1)).BeginInit();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
            this.groupBox4.SuspendLayout();
            this.groupBox5.SuspendLayout();
            this.groupBox6.SuspendLayout();
            this.SuspendLayout();
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(11, 138);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(250, 24);
            this.button1.TabIndex = 2;
            this.button1.Text = "Query custom control for the Selected Range";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // textBox1
            // 
            this.textBox1.Location = new System.Drawing.Point(266, 138);
            this.textBox1.Name = "textBox1";
            this.textBox1.ReadOnly = true;
            this.textBox1.Size = new System.Drawing.Size(82, 20);
            this.textBox1.TabIndex = 3;
            this.textBox1.Text = "textBox1";
            // 
            // label2
            // 
            this.label2.Location = new System.Drawing.Point(8, 173);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(253, 23);
            this.label2.TabIndex = 7;
            this.label2.Text = "Registered Notification for the Client";
            // 
            // textBox2
            // 
            this.textBox2.Location = new System.Drawing.Point(266, 170);
            this.textBox2.Name = "textBox2";
            this.textBox2.ReadOnly = true;
            this.textBox2.Size = new System.Drawing.Size(82, 20);
            this.textBox2.TabIndex = 8;
            this.textBox2.Text = "textBox2";
            // 
            // timer1
            // 
            this.timer1.Enabled = true;
            this.timer1.SynchronizingObject = this;
            this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elapsed);
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Controls.Add(this.rangeSelectorControl1);
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Controls.Add(this.textBox2);
            this.groupBox1.Controls.Add(this.button1);
            this.groupBox1.Controls.Add(this.textBox1);
            this.groupBox1.Location = new System.Drawing.Point(12, 13);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(357, 204);
            this.groupBox1.TabIndex = 10;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Range Control";
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.label1.Location = new System.Drawing.Point(11, 115);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(276, 13);
            this.label1.TabIndex = 10;
            this.label1.Text = "Output to the client application from the control assembly:";
            // 
            // rangeSelectorControl1
            // 
            this.rangeSelectorControl1.BackColor = System.Drawing.SystemColors.Control;
            this.rangeSelectorControl1.DelimiterForRange = ",";
            this.rangeSelectorControl1.DisabledBarColor = System.Drawing.Color.Olive;
            this.rangeSelectorControl1.DisabledRangeLabelColor = System.Drawing.Color.Gray;
            this.rangeSelectorControl1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.rangeSelectorControl1.GapFromLeftMargin = ((uint)(20u));
            this.rangeSelectorControl1.GapFromRightMargin = ((uint)(20u));
            this.rangeSelectorControl1.HeightOfThumb = 25F;
            this.rangeSelectorControl1.InFocusBarColor = System.Drawing.Color.DarkKhaki;
            this.rangeSelectorControl1.InFocusRangeLabelColor = System.Drawing.Color.DarkRed;
            this.rangeSelectorControl1.LabelFont = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold);
            this.rangeSelectorControl1.LeftThumbImagePath = null;
            this.rangeSelectorControl1.Location = new System.Drawing.Point(9, 15);
            this.rangeSelectorControl1.MiddleBarWidth = ((uint)(4u));
            this.rangeSelectorControl1.Name = "rangeSelectorControl1";
            this.rangeSelectorControl1.OutputStringFontColor = System.Drawing.Color.Black;
            this.rangeSelectorControl1.Range1 = "20";
            this.rangeSelectorControl1.Range2 = "50";
            this.rangeSelectorControl1.RangeString = "Selected Range:";
            this.rangeSelectorControl1.RangeValues = "10,20,30,40,50";
            this.rangeSelectorControl1.RightThumbImagePath = null;
            this.rangeSelectorControl1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
            this.rangeSelectorControl1.Size = new System.Drawing.Size(339, 83);
            this.rangeSelectorControl1.TabIndex = 9;
            this.rangeSelectorControl1.ThumbColor = System.Drawing.Color.Blue;
            this.rangeSelectorControl1.WidthOfThumb = 10F;
            this.rangeSelectorControl1.XMLFileName = null;
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.rangeSelectorControl2);
            this.groupBox2.Location = new System.Drawing.Point(385, 13);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(250, 77);
            this.groupBox2.TabIndex = 11;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "A tiny one";
            // 
            // rangeSelectorControl2
            // 
            this.rangeSelectorControl2.BackColor = System.Drawing.Color.LightBlue;
            this.rangeSelectorControl2.DelimiterForRange = ",";
            this.rangeSelectorControl2.DisabledBarColor = System.Drawing.Color.Gray;
            this.rangeSelectorControl2.DisabledRangeLabelColor = System.Drawing.Color.Gray;
            this.rangeSelectorControl2.Font = new System.Drawing.Font("Microsoft Sans Serif", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.rangeSelectorControl2.GapFromLeftMargin = ((uint)(10u));
            this.rangeSelectorControl2.GapFromRightMargin = ((uint)(10u));
            this.rangeSelectorControl2.HeightOfThumb = 15F;
            this.rangeSelectorControl2.InFocusBarColor = System.Drawing.Color.Indigo;
            this.rangeSelectorControl2.InFocusRangeLabelColor = System.Drawing.Color.Green;
            this.rangeSelectorControl2.LabelFont = new System.Drawing.Font("Microsoft Sans Serif", 6F, System.Drawing.FontStyle.Bold);
            this.rangeSelectorControl2.LeftThumbImagePath = null;
            this.rangeSelectorControl2.Location = new System.Drawing.Point(6, 19);
            this.rangeSelectorControl2.MiddleBarWidth = ((uint)(1u));
            this.rangeSelectorControl2.Name = "rangeSelectorControl2";
            this.rangeSelectorControl2.OutputStringFontColor = System.Drawing.Color.Black;
            this.rangeSelectorControl2.Range1 = "1";
            this.rangeSelectorControl2.Range2 = "10";
            this.rangeSelectorControl2.RangeString = "Range";
            this.rangeSelectorControl2.RangeValues = "1,2,3,4,5,6,7,8,9,10";
            this.rangeSelectorControl2.RightThumbImagePath = null;
            this.rangeSelectorControl2.Size = new System.Drawing.Size(238, 50);
            this.rangeSelectorControl2.TabIndex = 0;
            this.rangeSelectorControl2.ThumbColor = System.Drawing.Color.Purple;
            this.rangeSelectorControl2.WidthOfThumb = 5F;
            this.rangeSelectorControl2.XMLFileName = null;
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.rangeSelectorControl3);
            this.groupBox3.Location = new System.Drawing.Point(641, 13);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(222, 77);
            this.groupBox3.TabIndex = 12;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "A fatty one - in miles";
            // 
            // rangeSelectorControl3
            // 
            this.rangeSelectorControl3.BackColor = System.Drawing.SystemColors.Control;
            this.rangeSelectorControl3.DelimiterForRange = ",";
            this.rangeSelectorControl3.DisabledBarColor = System.Drawing.Color.Gray;
            this.rangeSelectorControl3.DisabledRangeLabelColor = System.Drawing.Color.Gray;
            this.rangeSelectorControl3.Font = new System.Drawing.Font("Microsoft Sans Serif", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.rangeSelectorControl3.GapFromLeftMargin = ((uint)(10u));
            this.rangeSelectorControl3.GapFromRightMargin = ((uint)(10u));
            this.rangeSelectorControl3.HeightOfThumb = 15F;
            this.rangeSelectorControl3.InFocusBarColor = System.Drawing.Color.DeepSkyBlue;
            this.rangeSelectorControl3.InFocusRangeLabelColor = System.Drawing.Color.Green;
            this.rangeSelectorControl3.LabelFont = new System.Drawing.Font("Microsoft Sans Serif", 6F, System.Drawing.FontStyle.Bold);
            this.rangeSelectorControl3.LeftThumbImagePath = null;
            this.rangeSelectorControl3.Location = new System.Drawing.Point(6, 19);
            this.rangeSelectorControl3.MiddleBarWidth = ((uint)(3u));
            this.rangeSelectorControl3.Name = "rangeSelectorControl3";
            this.rangeSelectorControl3.OutputStringFontColor = System.Drawing.Color.Black;
            this.rangeSelectorControl3.Range1 = "1m";
            this.rangeSelectorControl3.Range2 = "10m";
            this.rangeSelectorControl3.RangeString = "Range";
            this.rangeSelectorControl3.RangeValues = "1m,2m,3m,4m,5m,6m,7m,8m,9m,10m";
            this.rangeSelectorControl3.RightThumbImagePath = null;
            this.rangeSelectorControl3.Size = new System.Drawing.Size(210, 50);
            this.rangeSelectorControl3.TabIndex = 0;
            this.rangeSelectorControl3.ThumbColor = System.Drawing.Color.Purple;
            this.rangeSelectorControl3.WidthOfThumb = 10F;
            this.rangeSelectorControl3.XMLFileName = null;
            // 
            // groupBox4
            // 
            this.groupBox4.Controls.Add(this.rangeSelectorControl4);
            this.groupBox4.Location = new System.Drawing.Point(385, 108);
            this.groupBox4.Name = "groupBox4";
            this.groupBox4.Size = new System.Drawing.Size(478, 109);
            this.groupBox4.TabIndex = 12;
            this.groupBox4.TabStop = false;
            this.groupBox4.Text = "A Lengthy one in %";
            // 
            // rangeSelectorControl4
            // 
            this.rangeSelectorControl4.BackColor = System.Drawing.SystemColors.Control;
            this.rangeSelectorControl4.DelimiterForRange = ",";
            this.rangeSelectorControl4.DisabledBarColor = System.Drawing.Color.Gray;
            this.rangeSelectorControl4.DisabledRangeLabelColor = System.Drawing.Color.Gray;
            this.rangeSelectorControl4.Font = new System.Drawing.Font("Microsoft Sans Serif", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.rangeSelectorControl4.GapFromLeftMargin = ((uint)(15u));
            this.rangeSelectorControl4.GapFromRightMargin = ((uint)(15u));
            this.rangeSelectorControl4.HeightOfThumb = 15F;
            this.rangeSelectorControl4.InFocusBarColor = System.Drawing.Color.Cyan;
            this.rangeSelectorControl4.InFocusRangeLabelColor = System.Drawing.Color.Teal;
            this.rangeSelectorControl4.LabelFont = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold);
            this.rangeSelectorControl4.LeftThumbImagePath = null;
            this.rangeSelectorControl4.Location = new System.Drawing.Point(6, 19);
            this.rangeSelectorControl4.MiddleBarWidth = ((uint)(1u));
            this.rangeSelectorControl4.Name = "rangeSelectorControl4";
            this.rangeSelectorControl4.OutputStringFontColor = System.Drawing.Color.Black;
            this.rangeSelectorControl4.Range1 = "1%";
            this.rangeSelectorControl4.Range2 = "10%";
            this.rangeSelectorControl4.RangeString = "Range";
            this.rangeSelectorControl4.RangeValues = "1%,2%,3%,4%,5%,6%,7%,8%,9%,10%";
            this.rangeSelectorControl4.RightThumbImagePath = null;
            this.rangeSelectorControl4.Size = new System.Drawing.Size(466, 82);
            this.rangeSelectorControl4.TabIndex = 0;
            this.rangeSelectorControl4.ThumbColor = System.Drawing.Color.DarkCyan;
            this.rangeSelectorControl4.WidthOfThumb = 14F;
            this.rangeSelectorControl4.XMLFileName = null;
            // 
            // groupBox5
            // 
            this.groupBox5.Controls.Add(this.rangeSelectorControl5);
            this.groupBox5.Location = new System.Drawing.Point(12, 234);
            this.groupBox5.Name = "groupBox5";
            this.groupBox5.Size = new System.Drawing.Size(851, 106);
            this.groupBox5.TabIndex = 13;
            this.groupBox5.TabStop = false;
            this.groupBox5.Text = "One from XML file";
            // 
            // rangeSelectorControl5
            // 
            this.rangeSelectorControl5.BackColor = System.Drawing.SystemColors.Control;
            this.rangeSelectorControl5.DelimiterForRange = ",";
            this.rangeSelectorControl5.DisabledBarColor = System.Drawing.Color.Gray;
            this.rangeSelectorControl5.DisabledRangeLabelColor = System.Drawing.Color.Gray;
            this.rangeSelectorControl5.GapFromLeftMargin = ((uint)(15u));
            this.rangeSelectorControl5.GapFromRightMargin = ((uint)(15u));
            this.rangeSelectorControl5.HeightOfThumb = 20F;
            this.rangeSelectorControl5.InFocusBarColor = System.Drawing.Color.DarkViolet;
            this.rangeSelectorControl5.InFocusRangeLabelColor = System.Drawing.Color.Indigo;
            this.rangeSelectorControl5.LabelFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold);
            this.rangeSelectorControl5.LeftThumbImagePath = null;
            this.rangeSelectorControl5.Location = new System.Drawing.Point(14, 19);
            this.rangeSelectorControl5.MiddleBarWidth = ((uint)(2u));
            this.rangeSelectorControl5.Name = "rangeSelectorControl5";
            this.rangeSelectorControl5.OutputStringFontColor = System.Drawing.Color.Black;
            this.rangeSelectorControl5.Range1 = "30 lb";
            this.rangeSelectorControl5.Range2 = "190 lb";
            this.rangeSelectorControl5.RangeString = "Range";
            this.rangeSelectorControl5.RangeValues = "10 lb,20 lb,30 lb,40 lb,50 lb,60 lb,70 lb,80 lb,90 lb,100 lb,110 lb,120 lb,130 lb" +
                ",140 lb,150 lb,160 lb,170 lb,180 lb,190 lb";
            this.rangeSelectorControl5.RightThumbImagePath = null;
            this.rangeSelectorControl5.Size = new System.Drawing.Size(825, 80);
            this.rangeSelectorControl5.TabIndex = 0;
            this.rangeSelectorControl5.ThumbColor = System.Drawing.Color.Black;
            this.rangeSelectorControl5.WidthOfThumb = 10F;
            this.rangeSelectorControl5.XMLFileName = "testxml.xml";
            // 
            // groupBox6
            // 
            this.groupBox6.Controls.Add(this.rangeSelectorControl6);
            this.groupBox6.Location = new System.Drawing.Point(12, 366);
            this.groupBox6.Name = "groupBox6";
            this.groupBox6.Size = new System.Drawing.Size(845, 100);
            this.groupBox6.TabIndex = 15;
            this.groupBox6.TabStop = false;
            this.groupBox6.Text = "Slider is Image";
            // 
            // rangeSelectorControl6
            // 
            this.rangeSelectorControl6.BackColor = System.Drawing.SystemColors.Control;
            this.rangeSelectorControl6.DelimiterForRange = ",";
            this.rangeSelectorControl6.DisabledBarColor = System.Drawing.Color.Gray;
            this.rangeSelectorControl6.DisabledRangeLabelColor = System.Drawing.Color.Gray;
            this.rangeSelectorControl6.GapFromLeftMargin = ((uint)(10u));
            this.rangeSelectorControl6.GapFromRightMargin = ((uint)(10u));
            this.rangeSelectorControl6.HeightOfThumb = 20F;
            this.rangeSelectorControl6.InFocusBarColor = System.Drawing.Color.DarkOliveGreen;
            this.rangeSelectorControl6.InFocusRangeLabelColor = System.Drawing.Color.SeaGreen;
            this.rangeSelectorControl6.LabelFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold);
            this.rangeSelectorControl6.LeftThumbImagePath = "arrowleft.JPG";
            this.rangeSelectorControl6.Location = new System.Drawing.Point(9, 14);
            this.rangeSelectorControl6.MiddleBarWidth = ((uint)(2u));
            this.rangeSelectorControl6.Name = "rangeSelectorControl6";
            this.rangeSelectorControl6.OutputStringFontColor = System.Drawing.Color.Black;
            this.rangeSelectorControl6.Range1 = "0K";
            this.rangeSelectorControl6.Range2 = " 1B";
            this.rangeSelectorControl6.RangeString = "Range";
            this.rangeSelectorControl6.RangeValues = "0K, 100K, 200K, 300K,  400K, 500K, 600K, 700K, 800K, Good, 900K, 1M, Great, 10M, " +
                "1B";
            this.rangeSelectorControl6.RightThumbImagePath = "arrow.JPG";
            this.rangeSelectorControl6.Size = new System.Drawing.Size(830, 80);
            this.rangeSelectorControl6.TabIndex = 0;
            this.rangeSelectorControl6.ThumbColor = System.Drawing.Color.MidnightBlue;
            this.rangeSelectorControl6.WidthOfThumb = 10F;
            this.rangeSelectorControl6.XMLFileName = null;
            // 
            // TestApp
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(875, 532);
            this.Controls.Add(this.groupBox6);
            this.Controls.Add(this.groupBox5);
            this.Controls.Add(this.groupBox4);
            this.Controls.Add(this.groupBox3);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.MaximizeBox = false;
            this.Name = "TestApp";
            this.Text = "Test Application";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.TestApp_MouseMove);
            ((System.ComponentModel.ISupportInitialize)(this.timer1)).EndInit();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox3.ResumeLayout(false);
            this.groupBox4.ResumeLayout(false);
            this.groupBox5.ResumeLayout(false);
            this.groupBox6.ResumeLayout(false);
            this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new TestApp());
		}

		private void Form1_Load(object sender, System.EventArgs e)
		{
			timer1.Interval = 250;
			objNotifyClient = new CustomRangeSelectorControl.NotifyClient();
			
			rangeSelectorControl1.RegisterForChangeEvent(ref objNotifyClient);

			textBox2.Text = objNotifyClient.Range1 + " to " + objNotifyClient.Range2;
			textBox2.Update();

		}

		private void textBox1_TextChanged(object sender, System.EventArgs e)
		{
		
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			string strRange1;
			string strRange2;

			
//			userControl11.QueryRange(out strRange1, out strRange2);
						rangeSelectorControl1.QueryRange(out strRange1 , out strRange2);
			textBox1.Text = strRange1 + " - " + strRange2;
			textBox1.Update();

			object obj = strRange1;
			strRange1 = "100";
		}

		private void TestApp_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
		{
		
		}

		private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
		{
			textBox2.Text = objNotifyClient.Range1 + " to " + objNotifyClient.Range2;
			textBox2.Update();
		
		}

		private void rangeSelectorControl1_Load(object sender, System.EventArgs e)
		{
		
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Bharath K A
Software Developer (Senior)
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 21 Aug 2008
Article Copyright 2008 by Bharath K A
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid