To use slider to implement a very simple function, you can use a label to display a value when dragging. This feature is actually extremely simple, but it took me one hour.
At first, I didn't know that the slider was not displayed. I dragged a slider and set it to run it. I found that there was nothing bare, so I wanted to find the slider attribute. There are too many helplessness, and I will not understand it at half past one. Search for an articleArticleIntroduction autotooltip: The http://www.cnblogs.com/TianFang/archive/2009/07/04/1517027.html settings are displayed on the slider when you drag the runtime discovery, not what I want. Continue to find, and then there is an article about binding: http://www.diybl.com/course/4_webprogram/asp.net/netjs/2008624/128053.html results read for a long time, is bound to the textbox, can you bind on the label I did not try, also feel unnecessary. I only need to display and do not need to bind to each other. Continue to find, there is an article on msdn about label content can "Data Binding": http://msdn.microsoft.com/zh-cn/library/cc295312.aspx results how I try, did not find a drop-down list of content.
In fact, the most I want to find is the selectedchanged event like ListBox and ComboBox, and the result is actually found, valuechanged. But a new problem arises,
Private void slidervalue_valuechanged (Object sender, routedpropertychangedeventargs
E) {value = (INT) E. newvalue; txtbvalue. Text = value. tostring ();}
Txtbvalue. Text (textblock) is not acceptable! "The object is not set to reference instance .", I am afraid this is the most common and annoying mistake. I can't figure out what went wrong. Debugging is also unclear. Later I remembered that my slider was placed on the textblock, and there were different controls, and I didn't trigger this changed event. Try again anyway. The reason is true. The problem is solved. The specific reason is that it will be well studied later.
I haven't written a blog for a long time, so I really don't have time.