Hallo,
ich will einfach wie bei allen Grid mit der Methode MouseCoord die Mauskoordinaten in GridCoords umrechnen. Es handelt sich allerdings um die Calender Kompo die kein MouseMove oder ähnliches hat. Ist auch nicht wichtig da ich es im OnClick benötige. Es funzt aber nicht. Bekomme nur -1 für beide werte zurück. Also für Row und Col. Hier mal der Source:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
| ...
var Form1: TForm1; pCoord : TGridCoord;
procedure TForm1.CalendarClick(Sender: TObject); begin pCoord := Calendar.MouseCoord(Mouse.CursorPos.X,Mouse.CursorPos.Y); label2.Caption := 'Col: ' + IntToStr(pCoord.x) + ' ' + 'Row: ' + IntToStr(pCoord.y); end;
... |
Was stimmt denn nicht?!??!
PS: In Mouse.CursorPos.X und Y stehen richtige Werte. Habe ich schon getestet...