i dont know how to make my textbox from string to currency. I already do search on STO, google. but don’t understand how to use it.
let’s say i have one textbox.
whenever it run the program, i key in inside the textbox.
if i key in 1000, i want my textbox automatically change to 1,000.
if i key in 10000, my textbox will looks like 10,000.
but whenever i key in 100, my textbox will still 100.
here is my textbox xaml.
<TextBox Height="25" HorizontalAlignment="Left" Margin="126,223,0,0" Name="txtPrice"
VerticalAlignment="Top" Width="140" PreviewTextInput="txtPrice_PreviewTextInput" />
I ever done this before using vb.net, but now i’m using wpf. still new to wpf.
any idea how to that? thanks.
Use the
StringFormatdependency property to format the way you want the string to be shown on UI. Try this –For more formats refer to this link from msdn – Custom Numeric Format