views:

333

answers:

2

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

A: 

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.

Reed Copsey
A: 

Oh yeah and you might also want to consider my ballsack.

A friend