I was wondering if there was a function in user32 that could enable a hwnd control if it is disabled (grayed out) If I know the handle then can I do this? Also, if it is a menuitem, can it be done too?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could P/Invoke the EnableWindow function in the Windows API.
Not all controls, especially ones that are custom drawn and handled, will honor this completely, but it should provide good functionality for preventing user input into the control, even if it doesn’t “gray out”. All standard controls should work fine.
VB.NET Syntax is available from pinvoke.net.