Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a slider in c# defined like this:


C#
<Slider HorizontalAlignment="Center"  x:Name="rain_0"
                      Margin="3"
                      VerticalAlignment="Top"
                      Width="250"
                       Minimum="0" Maximum="1"  IsSnapToTickEnabled="True" TickFrequency="0.1"  AutoToolTipPrecision="1" AutoToolTipPlacement="BottomRight" ValueChanged="Slider_ValueChanged"/>


The tooltip shows the value of the slider with next format: 0,0 .

I want the tooltip displays the value with format 0.0 instead. Any easy way to acomplish this? I checked a bit about "ThumbToolTipValueConverter" but in my case maybe is to complex for my objetive. Another better way?
Posted

1 solution

The comma comes from your regional settings.
If they were e.g. English you would see a point.

The article below shows how you can modify the auto tool tip.
http://joshsmithonwpf.wordpress.com/2007/09/14/modifying-the-auto-tooltip-of-a-slider/[^]

Another way could be to suppress the auto tool tip
and show a text block below the slider which is data bound to the slider.
Then you could use any value converter you like.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900