Autor Beitrag
sagar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: So 10.08.03 11:16 
hallo! wie kann ich bei einem stringrid z.b. den markierten text in eine variable speichern?
hassedelphi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 101

WIN XP
D7 Enterprise
BeitragVerfasst: So 10.08.03 13:52 
im onclick ereigniss vom stringgrid, die mauskoordinaten irgentwie der jeweils entsprechenden zelle zuweisen. und dann a:=stringgrid1.cells[x,y].

_________________
you're not be able to help, that you're an human
recall
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 449



BeitragVerfasst: Mo 11.08.03 00:09 
Hallo,

Wenn du nur eine Zelle markiert hast, dann geht das über:
ausblenden Quelltext
1:
  S := StringGrid1.Cells[StringGrid1.Col, StringGrid1.Row];					



Nur der Vollständigkeit halber:

hassedelphi's Lösung geht auch, die Mausposition bekommst du mit
GetCursorPos(P: TPoint);
Aber x und y musst du erst von Bildschirmkoordinaten umrechnen auf StringGrid-Koords... Dazu brauchst du die Form1.Left, Top
von jedem Col die Breite, von jedem Row die Höhe...

Wenn dir das zu kompliziert war, dann tröste dich damit:
DU BRAUCHST DAS NICHT ! :D

@hassedelphi: Mir fällt grade auf => ich kann doch auch mit der Tastatur markieren !

Viele Grüsse.