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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -