wpf - Limit Slider TextBox Decimal Places -


i have slider , value textbox.

enter image description here

it gives value 14 decimal places.

how can limit (not round) amount of decimals 2? 75.89

limit in textbox, not process after. , not snap tick.

<slider x:name="slvolume"          horizontalalignment="right"         margin="0,92,48,0"          verticalalignment="top"          width="66"         maximum="100"          />  <textbox x:name="tbxvolume"          text="{binding elementname=slvolume, path=value, updatesourcetrigger=propertychanged}"          width="29"           height="22"           textwrapping="wrap"           margin="0,91,14,0"           horizontalalignment="right"           verticalalignment="top"/> 

add stringformat text binding:

text="{binding elementname=slvolume, path=value, stringformat=n2, updatesourcetrigger=propertychanged}" 

Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -