wpf - Limit Slider TextBox Decimal Places -
i have slider , value textbox.
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
Post a Comment