GNVQ
Intermediate IT Optional Unit 5
Tutors Sue Cahill and Colin Duley
Naming control
When you place controls onto a form when designing a VB program, you should change the name property of all the controls and the form to something meaningful.
The first three letters (prefix) of the name indicate the type of control.
e.g.1) a form for the calculation of a payslip could be renamed frmPayslip
e.g.2) a text box for displaying the date could be renamed txtDate
Naming conventions for controls used in VB
|
Control
|
Three letter prefix
|
|
Form
|
frm
|
|
Check box
|
chk
|
|
Combo box
|
cbo
|
|
Command button
|
cmd
|
|
Dir list box
|
dir
|
|
Drive list box
|
drv
|
|
File list box
|
fil
|
|
Frame
|
fra
|
|
Horizontal scroll bar
|
hsb
|
|
Image
|
img
|
|
Label
|
lbl
|
|
List box
|
lst
|
|
Menu
|
mnu
|
|
Option button
|
opt
|
|
Picture box
|
pic
|
|
Shape
|
shp
|
|
Text box
|
txt
|
|
Timer
|
tmr
|
|
Vertical scroll bar
|
vsb
|
Task
|
Suggest
a suitable setting for the Name property of the controls described below:
|
|
1)
A command button used to quit a program
|
|
2)
A text box that displays the name of a customer
|
|
3)
A picture box used to display the logo of a company
|
|
|
|
|