P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 15th, 2003 08:48 AM Post subject: Check if a control has a property |
|
|
| Code: | Public Function HasProperty(objObject As Object, strProperty As String) As Boolean
Dim varRet As Variant
On Error Resume Next
varRet = CallByName(objObject, strProperty, VbGet)
If Err.Number = 0 Then
HasProperty = True
End If
On Error GoTo 0
End Function |
Usage :
| Code: | Private Sub Form_Load()
MsgBox HasProperty(Form1, "Caption")
End Sub |
_________________ No one is completely useless. They can at least be an example of what to avoid. |
|