This is a migrated thread and some comments may be shown as answers.

RadTrackBar issue

2 Answers 113 Views
TrackBar
This is a migrated thread and some comments may be shown as answers.
Den
Top achievements
Rank 1
Den asked on 10 Jan 2014, 07:41 AM
When I set value using RadTrackBar.Value (using  either code or designer), visually it doesn't properly corresponds to what is has to.
 For example, Mininum = 20, Maximum = 200, Value = 100, but on the screen thumb is at the right end of control. Also, I think, that it is related - to set value higher than 100 - user has to move mouse out of control to the right side.
Controls version: 2013.3.1127.40

private void InitializeComponent()
{
  this.radTrackBar1 = new Telerik.WinControls.UI.RadTrackBar();
  ((System.ComponentModel.ISupportInitialize)(this.radTrackBar1)).BeginInit();
  this.SuspendLayout();
  //
  // radTrackBar1
  //
  this.radTrackBar1.Location = new System.Drawing.Point(13, 13);
  this.radTrackBar1.Maximum = 200F;
  this.radTrackBar1.Minimum = 20F;
  this.radTrackBar1.Name = "radTrackBar1";
  this.radTrackBar1.Size = new System.Drawing.Size(150, 17);
  this.radTrackBar1.TabIndex = 0;
  this.radTrackBar1.TickStyle = Telerik.WinControls.Enumerations.TickStyles.None;
  this.radTrackBar1.Value = 100F;
  //
  // Form1
  //
  this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
  this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  this.ClientSize = new System.Drawing.Size(292, 273);
  this.Controls.Add(this.radTrackBar1);
  this.Name = "Form1";
  this.Text = "Form1";
  ((System.ComponentModel.ISupportInitialize)(this.radTrackBar1)).EndInit();
  this.ResumeLayout(false);
  this.PerformLayout();
 
}

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Jan 2014, 03:13 PM
Hello Den,

Thank you for contacting Telerik Support.

It is necessary to modify not only the Minimum and Maximum properties, but also SmallTickFrequency and LargeTickFrequency in order to obtain correct scrolling. The tick marks participate in the Value indicating and if the control size is smaller than the required size to display all available ticks correctly, you encounter the described behavior. That is why it is necessary to reduce ticks number to indicate correctly the Value when the thumb is positioned in the right end:  
public Form1()
{
    InitializeComponent();
 
    this.radTrackBar1.SmallTickFrequency = 10;
    this.radTrackBar1.LargeTickFrequency = 50;
}

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Den
Top achievements
Rank 1
answered on 13 Jan 2014, 03:21 PM
this.radTrackBar1.SmallTickFrequency = 10;
this.radTrackBar1.LargeTickFrequency = 50;

Hi,

 Thanks, that solves the problem.

Tags
TrackBar
Asked by
Den
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Den
Top achievements
Rank 1
Share this question
or