RadTrackBar issue

3 posts, 0 answers
  1. Den
    Den avatar
    2 posts
    Member since:
    Jan 2014

    Posted 10 Jan 2014 Link to this post

    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. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 13 Jan 2014 Link to this post

    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 >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Den
    Den avatar
    2 posts
    Member since:
    Jan 2014

    Posted 13 Jan 2014 Link to this post

    this.radTrackBar1.SmallTickFrequency = 10;
    this.radTrackBar1.LargeTickFrequency = 50;

    Hi,

     Thanks, that solves the problem.

Back to Top