Traditional Culture Encyclopedia - Weather forecast - Wpf slider drag slider bubble prompt

Wpf slider drag slider bubble prompt

Drag the slider bubble tips are as follows:

First create the project and add the slider control. Then get the window style of the slider.

Then the interface pops up. We click OK.

After clicking OK, a series of style codes are added to the resources of our page, and the slider code will be modified as follows: In the above code, we can see that the slider uses the SliderHorizontal template, but when its arrangement direction is vertical, the SliderVertical template is used. Because the slider control is laid out horizontally by default, we first modify the SliderHorizontal template to beautify the slider. Similarly, we continue to follow the definition of SliderHorizontal in F 12.

There are many definitions of the SliderHorizontal template, and the key content-track is directly defined here. Navigate to the code first.

SliderThumbHorizontalDefault template, so let's follow up on F 12 and see its definition.

As can be seen from the above code, the definition of slider is very simple, and the layout is that a path is placed in a grid with only three event responses. The following is to modify the fill color of the path and the underline color of the stroke. As long as you start with the template SliderVertical, you can handle the modification.