码迷,mamicode.com
首页 > 其他好文 > 详细

StringGrid右击选中表格(右键点击也是MouseDown)

时间:2015-08-18 21:04:47      阅读:301      评论:0      收藏:0      [点我收藏+]

标签:

顺便还把单元格给变了:

procedure TFGLGL.StringGrid1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
    MousePos:   TSmallPoint;
begin
    if   Button   =   mbRight   then
    begin
        MousePos.x   :=   x;
        MousePos.y   :=   y;
        SendMessage(StringGrid1.Handle, WM_LBUTTONDOWN, 0, MAKELONG(x, y));
        SendMessage(StringGrid1.Handle, WM_LBUTTONUP, 0, MAKELONG(x, y));
    end;
end;

参考:http://www.cnblogs.com/lovemoon714/archive/2012/06/25/2561187.html

StringGrid右击选中表格(右键点击也是MouseDown)

标签:

原文地址:http://www.cnblogs.com/findumars/p/4740582.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!