Einzelnen Beitrag anzeigen

axellang

Registriert seit: 3. Mai 2003
Ort: München
138 Beiträge
 
Delphi XE2 Enterprise
 
#5

AW: StringGrid - Reihen - Spalten - Schnittpunkt Markieren

  Alt 30. Mär 2014, 14:03
Hallo,

zB. senkrecht markieren in MouseMove.
Aber wie gesagt, beide krieg ich nicht hin.

//TEST
Delphi-Quellcode:
procedure TfrmKeyCard.SGMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
  GR : TGridRect;
  aCol, aRow : LongInt;
begin
  (* Returns the column and row of the cell at the
     position with screen coordinates (X,Y) *)

  SG.MouseToCell(X,Y,aCol,aRow);
  if (aCol = 0) or (aRow = 0) then
    Exit;

 // Grid Select
 GR.Left := aCol;
 GR.Top := 1;
 GR.Right := aCol;
 GR.Bottom := aRow;
 SG.Selection := GR;

end;
Axel
Alexander Lang

Geändert von axellang (30. Mär 2014 um 14:07 Uhr)
  Mit Zitat antworten Zitat