Article ID: 171972
Article Last Modified on 12/10/2003
Private Declare Function EnableWindow Lib "user32" Alias _
"EnableWindow" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
Public Property Get hWnd() as Long
hWnd=UserControl.hWnd
End Property
Dim result as Long
result = EnableWindow(Me.UserControl1.hWnd, 0)
To enable the UserControl:
Dim result as Long
result = EnableWindow(Me.UserControl1.hWnd, 1)
Public Property Get enabled() As Boolean
enabled = UserControl.enabled
End Property
Public Property Let enabled(vNewValue As Boolean)
UserControl.enabled = vNewValue
End Property
Private Sub UserControl_Click()
MsgBox "Control is not Disabled."
End Sub
Name: Command1 Caption: "Enable Control"
Name: Command2 Caption: "Disable Control"
Private Sub Command1_Click()
Me.UserControl11.Enabled = True
End Sub
Private Sub Command2_Click()
Me.UserControl11.Enabled = False
End Sub
Public Sub Main()
Form1.Show vbModal
End Sub
Form1.Show vbModal
to:
Form1.Show
Additional query words: kbComp kbCtrl kbVBp kbdsd kbVBp500bug kbVBp600fix kbDSupport kbCtrlCreate kbAPI
Keywords: kbbug kbfix KB171972