Handling windows notifications in derived C# user control

前端 未结 3 437
梦谈多话
梦谈多话 2021-01-27 04:07

How can I handle any of the tree view notifications listed here in a C# class that is derived from the .NET TreeView control?

I tried to handle the click notification, f

3条回答
  •  猫巷女王i
    2021-01-27 05:05

    Notifications are sent to the control's parent:

    Notifies the parent window of a tree-view control that the user has clicked the left mouse button within the control.

    This is done with the WM_NOITIFY message. Luckily, the authors also included a mechanism called reflection to allow sub classes of the treeview to receive the notifications too. The message is &H2000 | WM_NOTIFY which you can treat exactly as WM_NOTIFY.

    Also note that NM_CLICK is not a message, but a notification wrapped inside an NMHDR structure

    This notification code is sent in the form of a WM_NOTIFY message.

提交回复
热议问题