The price is to be entered into the txtPrice box. The resulting tax will be displayed in the txtTax box. This procedure will be executed every time you click on the Calculate Tax button, while the program is running. Assign the value typed into the txtPrice box to the variable Price. The data that the user enters into the txtPrice.
Text box is a string of characters.
In order to treat this string as a number, we have to take the numeric value of it. Any time we want to treat the contents of a text box as a number, we have to first convert its value to a number. Also note that any line preceded by a single quotation mark will be treated as a comment and used only to describe what the instructions do. The Format function is used to display data in an appropriate manner. In the procedure above, it is used to display the tax as Currency .