Naming Textboxes etc...
You never want to leave a textbox or anything similar unnamed, otherwise when looking at the code you'll wonder what is what. This section will teach you how to name basic things used in basicly all programs.
First, there is a prefix that goes infront of the name.
- Textbox: txt
- ComboBox: cbo
- Option buttons: opt
- Image: img
- Check Box: chk
- CommandButton: cmd
- Lable: lbl
- Form: frm
Well thats the prefix...but how to I name it? I will give examples below.
- txtName
- cboName
- optName
- imgName
- chkName
- cmdName
- lblName
- frmName
Where I put "Name" Is where you add the name you want it. For example. If I have a textarea where People will input a number, I could name it txtNumber and so on. But, I know how to name, where do I write the name?
Look in your properties, depending on if its on catagory or alphebetical, it will be in a different area. In your properties window there is a place where it says Name, it will have something already in for the name. Like if i just made a textarea and it was the first one it would say
Name: Text1
Naming is very simple, the most simple thing in programming. It makes everything more simple to find and remember what each one is, and important to programming when you want to make a program cause you'll have to write the names for it to do stuff depending on what you want it to do at times.