How to discard mouse click in TDbGrid.OnColumnMoved

前端 未结 1 330
星月不相逢
星月不相逢 2021-01-18 11:26

In a TDbGrid.OnColumnMoved event handler, I adjust some column headings colors.

I also use the grid\'s OnTitleClicked event to pop-up a (so

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-18 12:04

    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.

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