Академический Документы
Профессиональный Документы
Культура Документы
FUNCTION
Menu name
Use prefix ‘mnu’ for menu
Menu
COMMON DIALOG BOXES
To use the dialog box, you have to specify which box
you want using Show method
Object.ShowMethod
Dialog box Method
Open ShowOpen
Save As ShowSave
Color ShowColor
Font ShowFont
Print ShowPrint
Color Dialog Box
.Color = lblDispSubTotal.ForeColor
'Set initial color which is ‘first displayed on the palette
End Sub
SUB PROCEDURE
End With
End Sub
Prive Sub cmdChangeMessgase_Click()
Dim lngOriginalColor As Long
lngOriginalColor = lblMessgase.ForeColor
SelectColor lngOriginalColor
lblMessage.Forecolor = dlgColor.Color
End Sub
Passing Argument ByVal or ByRef
The ByVal sends a copy of the argiment’s value to the
procedure so that the procedure cannot change the original
value.
ByRef sends a reference indicating where the value is stored
in the memory, allowing the called procedure to actually
change the argument’s original value.
You have to specify how you want to pass the argument,
ByVal or ByRef. If you don’t specify, arguments are passed
by reference.
A sub procedure is a procedure that performs actions.
A function procedure may perform an action but it also
returns a value (the return value) to the point from which it is
called.
Private Function curFindTax(curAmount As Currency)
As Currency
curFindTax = mcurTaxRate * curAmount
End Function