|
|
|||
|
Basics More Complex Examples
|
Text Box Controls In Vb.Net
The main use of textboxes are to obtain data from the user. We all have filled in forms during application setups and more. The squares where we insert our User Names and Passwords are textboxes. Textboxes can also be locked so that the user can only view the data displayed in the textbox. Should you decide to use a textbox for Passwords, set the Password Char attribute to the character you want to be displayed. If you set the Password Char to "*", and enter the password "1234", the textbox will show "****".
We Can do a simple example to demonstrate how it works. Open a new project. Change the Forms Text attribute from "Form1" to "Please enter your password". Create a Textbox by double clicking on the Textbox Icon in the Tools window. A Textbox called TextBox1 will be created on the form. Follow the same procedure to create a Label, which by default will be called Label1. Change the Labels Text attribute to "Please Register". Also create a Button and change its text to "Submit". In the textbox attributes for TextBox1 set the Password Char to "*". Space the Controls as in the next figure.
Double click on your Form to go to the
Load event. In the Load event enter "Me.AcceptButton = Button1".
Public Class Form1
Run the application and change the password a couple of times to see how
the code works.
Email us at: info@pro2visual.com
|
Popular Articles Moving a borderless form in vb.net Link Progress Bar with Timer in vb.net How to open a folder using the process control |
|
|
|
|||