Is there a code that checks if a window or control is enabled or disabled?
Printable View
Is there a code that checks if a window or control is enabled or disabled?
not really. if you check to see if it's enabled, it will be loaded. it's better to have a flag to show the state for use in another procedure.
Like check its Enabled Property?
Checking the property will load and enable it.
Command2 returned false...
VB Code:
Private Sub Command1_Click() frmCancelReason.Enabled = False End Sub Private Sub Command2_Click() MsgBox frmCancelReason.Enabled End Sub
I'm talking about checking if a window or control in another program is enabled.
Don't get what you mean but you can cycle through the Screen.ActiveControl method to find what controls are enabled or look through the Controls Collection and the Forms Collection to see what is loaded.
Never mind. I found the IsWindowEnabled and IsWindowVisible APIs.
This would give you information on the Window itself, not the controls within the window.Quote:
Originally Posted by abazabam