|
|
Title | Use CallByName to get property values by name |
Description | This example shows how to use CallByName to get property values by name in Visual Basic 6. The program calls the CallByName function passing it the property name and the access method VbGet (property get). |
Keywords | CallbyName, property |
Categories | Software Engineering, Tips and Tricks |
|
|
The program calls the CallByName function passing it the property name and the access method VbGet (property get).
|
|
Private Sub cmdGet_Click()
Dim result As Variant
On Error GoTo CallByNameError
result = CallByName(m_Person, txtProperty.Text, _
VbGet)
lblValue.Caption = result
Exit Sub
CallByNameError:
MsgBox "Error " & Err.Number & " getting property." & _
vbCrLf & Err.Description
Resume Next
End Sub
|
|
|
|
|
|