How to discard mouse click in TDbGrid.OnColumnMoved

情到浓时终转凉″ 提交于 2019-12-01 17:16:21

As mentioned in comments to the question, you would supply the 'Msg' for PeekMessage yourself (var Msg: TMsg). But discarding the message that triggers OnTitleClickis not possible because it is the same message that fires both events. VCL carries out column moving in response to a WM_LBUTTONUP message if a column has been dragged. Later during the handling of the same message OnTitleClick is called.

IOW, while you can remove messages from the message queue with PeekMessage, the message that triggers OnTitleClick is already dispatched since we are in an OnColumnMoved handler.

Easiest approach looks like setting the flag as you've told.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!