How to Format a MaskedTextBox in Currency Using VB.Net

In this tutorial, I will teach you how to format a textbox in currency using maskedtextbox. With this method you can format or filter a textbox in a currency mode. This simple application is made of Microsoft Visual Studio 2015. Check out the following steps below.

Creating Application

Step 1

Open Microsoft Visual Studio 2015 and create a new windows form application. After that, do the Form just like this. formtxt1

Step 2

Double click the form to fire the load event handler and do the following code to assign the value in the textbox.
  1.         MaskedTextBox1.Text = "000"
  2.         MaskedTextBox2.Text = "0000"
  3.         MaskedTextBox3.Text = "00000"
  4.         MaskedTextBox4.Text = "000000"
  5.         MaskedTextBox5.Text = "0000000"
  6.         MaskedTextBox6.Text = "00000000"
  7.         MaskedTextBox7.Text = "000000000"

Step 3

Go back to the design views and double click the button to fire the click event handler of it. Then, do the following code to filter the textbox in currency.
  1.          MaskedTextBox1.Mask = "0.00"
  2.         MaskedTextBox2.Mask = "00.00"
  3.         MaskedTextBox3.Mask = "000.00"
  4.         MaskedTextBox4.Mask = "0,000.00"
  5.         MaskedTextBox5.Mask = "00,000.00"
  6.         MaskedTextBox6.Mask = "000,000.00"
  7.         MaskedTextBox7.Mask = "0,000,000.00"
For more question about this article. You can contact me @ Email – [email protected] Mobile No. – 09305235027 – TNT FB Account – https://www.facebook.com/onnaj.soicalap Or feel free to comment below

Add new comment