Sunday, March 30, 2008

How do I get rid of the ding that occurs when pressing enter on a TreeView control?

This can be easily fixed by overriding the default behavior of the WM_CHAR message. First subclass the control's window procedure using SetWindowLongPtr, then inside the new procedure use the following.
switch(message)
{
...
case WM_CHAR:
return 0;
...
}

No comments: