How to disable a window with EnableWindow(), and gray it out?

后端 未结 1 1270

In .NET, when you set the Control.Enabled property of a Form or a Control (such a a ListView) to false, it becomes grayed out, along with all its children:

相关标签:
1条回答
  • 2021-01-20 16:05
    BOOL EnableWindow(HWND hWnd,
        BOOL bEnable
    );
    

    where hWnd is the handle to the control and bEnable is either TRUE or FALSE, TRUE enables the window and FALSE disables it.

    Works fine for listviews.

    It is worth nothing that in order to see the changes to its visual state, you'll need to force the window to be redrawn, e.g. by calling UpdateWindow.

    0 讨论(0)
提交回复
热议问题