locked
[W8.1]Slider control Ticks RRS feed

  • Question

  • In windows store app 8.1, is there a way to use specific ticks for the slider control,  I can't use the ticks Frequency because my ticks is not evenly separated, like for a slider from 0-100 , I want a ticks on 13,25,40,50,75, is there a way to do this with the native slider?

    Thanks


    Tariq


    Friday, June 12, 2015 1:54 PM

Answers

  • Hi JORDAN RTG,

    Welcome to the Developing Universal Windows apps forum! 
    Please read the sticky posts, especially the Guide to posting: subject line tags and Known Issues for Windows 10 SDK and Tools  
    I will help you add the tag this time, I hope you can add the tag by yourself next time. :)

    In my mind, currently if you want to use the specific ticks for the slider control in Windows Store app 8.1, you may need to re-template the Slider and create a custom template for the TickBar to show the value which you want. As workaround, you can try to get a notification when the current ticks value are 13,25,40,50,70 as following:

    private async void MySlider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
            {
                if(MySlider.Value==13)
                {
                    MessageDialog MessageDialog = new MessageDialog("The current Silder value is 13");
                    await MessageDialog.ShowAsync();
                }
                else if(MySlider.Value==25)
                {
                    MessageDialog MessageDialog = new MessageDialog("The current Silder value is 25");
                    await MessageDialog.ShowAsync();
                }
                else if (MySlider.Value == 40)
                {
                    MessageDialog MessageDialog = new MessageDialog("The current Silder value is 40");
                    await MessageDialog.ShowAsync();
                }
                else if (MySlider.Value == 50)
                {
                    MessageDialog MessageDialog = new MessageDialog("The current Silder value is 50");
                    await MessageDialog.ShowAsync();
                }
                else if (MySlider.Value == 75)
                {
                    MessageDialog MessageDialog = new MessageDialog("The current Silder value is 75");
                    await MessageDialog.ShowAsync();
                }
                
            }

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, June 15, 2015 2:57 AM