Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 873399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:55:40+00:00 2026-05-15T10:55:40+00:00

I am trying to make a range control which is basically a slider control

  • 0

I am trying to make a range control which is basically a slider control with an extra thumb. The only code I found for one already built is here.

http://www.codeplex.com/AvalonControlsLib

For the life of me I cannot get a tooltip to show up above each thumb (with the current value) while it is being moved. It will show a short mouse hover tooltip, but it disappears when the thumb is being moved. Does anyone know anything about this particular control, or how you would add a second thumb to the slider control and use it the same way? I’ve found this basic question on a few forums with no answer besides pointing to the above link. Of course, people always mention how easy it is without showing or explaining how you would go about it. Thanks in advance.

Bob

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:55:41+00:00Added an answer on May 15, 2026 at 10:55 am

    I am assuming you are trying to use the Avalon Controls from here: Avalon Controls

    I added a tooltip to the thumbs in the control template and called it PART_LeftToolTip

    <ControlTemplate TargetType="{x:Type Controls:RangeSlider}">
        <StackPanel Orientation="Horizontal" Name="PART_RangeSliderContainer">
             <RepeatButton Name="PART_LeftEdge"/>                        
             <Thumb Name="PART_LeftThumb" Cursor="SizeWE">
                   <Thumb.ToolTip>
                         <ToolTip Name="PART_LeftToolTip" />        
                   </Thumb.ToolTip>
              </Thumb>                                             
              <Thumb Name="PART_MiddleThumb" Cursor="ScrollWE" MinWidth="1"/>
              <Thumb Name="PART_RightThumb" Cursor="SizeWE">
                    <Thumb.ToolTip>
                          <ToolTip Name="PART_RightToolTip" />
                    </Thumb.ToolTip>
              </Thumb>
              <RepeatButton Name="PART_RightEdge"/>
          </StackPanel>
    </ControlTemplate>
    

    I added them as template parts to the RangeSlider control

    TemplatePart(Name = "PART_LeftToolTip", Type = typeof(ToolTip)),
    TemplatePart(Name = "PART_RightToolTip", Type = typeof(ToolTip))]
    public sealed class RangeSlider : Control
    

    In the OnApplyTemplate method I did the following

    _leftPreviewToolTip = EnforceInstance<ToolTip>("PART_LeftToolTip");
    _rightPreviewToolTip = EnforceInstance<ToolTip>("PART_RightToolTip");
    

    Inside the InitializeVisualElements method I added the following

    private void InitializeVisualElementsContainer()
    {
       // ** same as before ** //
    
       _leftPreviewToolTip.PlacementTarget = _leftThumb;
       _rightPreviewToolTip.PlacementTarget = _rightThumb;
    }
    

    Now for the fun parts, basically you want to display this tooltip when the thumbs are moved. For the left tooltip, you want it to show when the left thumb is moved or when the center thumb is moved. I created a method called, ShowLeftTooltip and call it from LeftThumbDragDelta and CenterThumbDragDelta respectively.

    private void ShowLeftToolTip()
    {
        _leftPreviewToolTip.IsOpen = AutoToolTip;
        // This is a little trick to cause the ToolTip to update its position next to the Thumb
        _leftPreviewToolTip.HorizontalOffset = _leftPreviewToolTip.HorizontalOffset == 0.0 ? 0.001 : 0.0;
    }
    

    That tip to move the tooltip is not something I thought of, I got it from another post somewhere.

    I’ll leave it as an exercise to the reader to implement the right tooltip.

    You can style the tooltip so this allows a flexible display. Don’t forget to give the tooltip something as a data context so that it won’t be blank.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 485k
  • Answers 485k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Because Webkit is opensource, the answer is: yes, you can.… May 16, 2026 at 7:40 am
  • Editorial Team
    Editorial Team added an answer You're getting an illegal offset type error because array keys… May 16, 2026 at 7:40 am
  • Editorial Team
    Editorial Team added an answer I've read this over and over and I still don't… May 16, 2026 at 7:40 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.