Enable/Disable control in any frame
Enable/Disable control in any frame
API Declarations
'Enable or Disable all the objects that are in any frame
'IN:
' f - Form
' fr - Frame Object
' bEnable - Enable OR Disable Value
'(OPTIONAL):
' bNoNestedFrame - Include nested frame object also!
'NOTE:
' If you include nested frame, the objects that are in nested frames are not changed, but
' the frame whole, itself is disabled.
' To disable all the object of nested frame, call seperately
Rate Enable/Disable control in any frame
(1(1 Vote))
'Variables...
Dim o As Object
Dim lhWnd As Long
On Error GoTo errFE
'Check all the objects...
For Each o In f
'Get container's hWnd...
lhWnd = o.Container.hwnd
'Verify and make enable or disable accordingly...
If lhWnd <> 0 And _
lhWnd = fr.hwnd Then
If Not (TypeOf o Is Frame And _
bNoNestedFrame) Then _
o.Enabled = bEnable
End If
Next o
Exit Sub
errFE:
'err 438, Object doesn't support this property or method.
'(As we don't know what the object is!)
If Err = 438 Then lhWnd = 0: Resume Next
MsgBox "Error " & Err & vbNewLine & vbNewLine & _
Error, vbCritical, f.Caption
Err.Clear
End Function
'Please tell me about bugs or suggestions... etc
Enable/Disable control in any frame Comments
No comments yet — be the first to post one!
Post a Comment