From b72afad289adc986f8aebaa136726f99a7130b52 Mon Sep 17 00:00:00 2001 From: KrithikaGanesan Date: Wed, 22 Oct 2025 19:15:03 +0530 Subject: [PATCH 1/2] 985360: Updated ReadMe file of this repository --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a578f46..e2f5bb8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,28 @@ # How-to-customize-the-range-intervals-in-Winforms-RangeSlider -This session describes how to customize the range intervals in Winforms RangeSlider +The **Syncfusion WinForms RangeSlider** control provides an option to customize the range of the slider to meet specific application requirements. By adjusting properties such as **Minimum**, **Maximum**, **TickFrequency**, and **StartPosition**, you can create a slider that fits your desired range and layout. + +## Why Customize the Range? +Customizing the range intervals allows you to: +- Define the minimum and maximum values for the slider. +- Control the tick frequency for precise value selection. +- Position the form appropriately for better user experience. + +## Key Properties +- **Minimum**: Sets the lowest value of the slider. +- **Maximum**: Defines the highest value of the slider. +- **TickFrequency**: Determines the interval between ticks. +- **StartPosition**: Specifies the initial position of the form. + +## Example Code +```csharp +// To Customize the Range +this.rangeSlider1.Minimum = 1; +this.rangeSlider1.Maximum = 10; +this.rangeSlider1.TickFrequency = 1; +this.StartPosition = FormStartPosition.CenterScreen; +``` + +This example sets the slider range from **1 to 10**, with a tick frequency of **1**, and centers the form on the screen. + +For more details, refer to the official Syncfusion Knowledge Base article: +🔗 [How to Customize the Range Intervals in WinForms RangeSlider](https://www.syncfusion.com/kb/11982/how-to-customize-the-range-intervals-in-winforms-rangeslider) \ No newline at end of file From 5cf0df375ee1a3dbac02f9857897fde9725c884c Mon Sep 17 00:00:00 2001 From: Manivannan-E <92844213+Manivannan-E@users.noreply.github.com> Date: Thu, 20 Nov 2025 16:05:12 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 49 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e2f5bb8..a927623 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,51 @@ -# How-to-customize-the-range-intervals-in-Winforms-RangeSlider -The **Syncfusion WinForms RangeSlider** control provides an option to customize the range of the slider to meet specific application requirements. By adjusting properties such as **Minimum**, **Maximum**, **TickFrequency**, and **StartPosition**, you can create a slider that fits your desired range and layout. +# How to Customize the Range Intervals in WinForms RangeSlider +The Syncfusion WinForms RangeSlider control provides options to customize the slider range to meet specific application requirements. By adjusting properties such as Minimum, Maximum, TickFrequency, and handling the DrawLabel event, you can create a slider that fits your desired range and display format. ## Why Customize the Range? Customizing the range intervals allows you to: - Define the minimum and maximum values for the slider. - Control the tick frequency for precise value selection. -- Position the form appropriately for better user experience. +- Display custom labels (e.g., time intervals) for better user experience. ## Key Properties + - **Minimum**: Sets the lowest value of the slider. - **Maximum**: Defines the highest value of the slider. - **TickFrequency**: Determines the interval between ticks. +- **ShowLabels**: Enables label display on the slider. - **StartPosition**: Specifies the initial position of the form. ## Example Code -```csharp -// To Customize the Range -this.rangeSlider1.Minimum = 1; -this.rangeSlider1.Maximum = 10; -this.rangeSlider1.TickFrequency = 1; -this.StartPosition = FormStartPosition.CenterScreen; -``` +```C# +public Form1() +{ + InitializeComponent(); + + // Configure RangeSlider properties + this.rangeSlider1.DrawLabel += RangeSlider1_DrawLabel; + this.rangeSlider1.ShowLabels = true; + this.rangeSlider1.Minimum = 1; + this.rangeSlider1.Maximum = 10; + this.rangeSlider1.TickFrequency = 1; -This example sets the slider range from **1 to 10**, with a tick frequency of **1**, and centers the form on the screen. + // Center the form on the screen + this.StartPosition = FormStartPosition.CenterScreen; +} + +private void RangeSlider1_DrawLabel(object sender, DrawLabelEventArgs e) +{ + // Convert slider value to time intervals + TimeSpan timeSpan = new TimeSpan(0, 30, 0); + for (int i = 0; i < e.Value; i++) + { + timeSpan = timeSpan.Add(new TimeSpan(0, 30, 0)); + } + + DateTime time = DateTime.Today.Add(timeSpan); + e.Text = time.ToString("hh:mm tt"); + e.Handled = true; +} +``` -For more details, refer to the official Syncfusion Knowledge Base article: -🔗 [How to Customize the Range Intervals in WinForms RangeSlider](https://www.syncfusion.com/kb/11982/how-to-customize-the-range-intervals-in-winforms-rangeslider) \ No newline at end of file +## Reference +For more details, refer to the official Syncfusion Knowledge Base: https://www.syncfusion.com/kb/11982/how-to-customize-the-range-intervals-in-winforms-rangeslider