C caidaoli Unregistered / Unconfirmed GUEST, unregistred user! 2001-04-20 #2 procedure TForm1.wwDBGrid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var g:TGridCoord; begin g := wwDBGrid1.MouseCoord(X,Y); Caption :=Format('Col:%d,Row:%d',[g.x,g.y]); end;
procedure TForm1.wwDBGrid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var g:TGridCoord; begin g := wwDBGrid1.MouseCoord(X,Y); Caption :=Format('Col:%d,Row:%d',[g.x,g.y]); end;
D dptt Unregistered / Unconfirmed GUEST, unregistred user! 2001-04-20 #3 谢谢caidaoli;再请教: 在wwdbgrid中,怎样知道当前编辑焦点是否在指定的列中.
C caidaoli Unregistered / Unconfirmed GUEST, unregistred user! 2001-04-21 #4 THackGrid=class(TDbGrid) property Col; property Row; end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.DBGrid1DblClick(Sender: TObject); begin with THackGrid(Sender) do self.caption :=Format('Col:%d,Row:%d',[Col,Row]); end;
THackGrid=class(TDbGrid) property Col; property Row; end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.DBGrid1DblClick(Sender: TObject); begin with THackGrid(Sender) do self.caption :=Format('Col:%d,Row:%d',[Col,Row]); end;