Autor Beitrag
bf109g.01
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84



BeitragVerfasst: Di 23.03.10 11:25 
Hallo,
ich möchte gern bei KLick auf eine Zelle in einer Grid-Tabelle deren Koordianten in Edit-Feldern ausgeben.
Wie muss ich das machen?
Danke
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm6.SG1SelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean);
begin
{ SG1.Cells.selected ???
  SG1.ACol ???
  Keine Ahnung eben... :(
}
   
end;
JoelH
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Di 23.03.10 11:29 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.sg1SelectCell(Sender: TObject; ACol, ARow: Integer;
  var CanSelect: Boolean);
begin
  Edit1.Text := IntToStr(ARow);
  Edit2.Text := IntToStr(ACol);
end;

_________________
mfg. Joel
bf109g.01 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84



BeitragVerfasst: Di 23.03.10 11:30 
Oh... ja klar... Brett vorm Kopf, das war jetzt zu offensichtlich... :-/

Danke auf jeden Fall. :)

---Moderiert von user profile iconNarses: Beiträge zusammengefasst---

Hallo nochmal. Das funktioniert leider irgendwie nicht.
Wie wird das Ereignis Select audgelöst? Wenn ich einfach nur Einfach-/Doppelklicke rührt sich nichts... :cry:
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 23.03.10 13:49 
- Nachträglich durch die Entwickler-Ecke gelöscht -
bf109g.01 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84



BeitragVerfasst: Di 23.03.10 14:33 
Danke, das funktioniert auch, lag an einem logischen Fehler meinerseits.

Noch ne Frage: wie kann ich das Ereignis rückwärts laufen lassen (Edit-Felder eingeben -> Focus springt im Grid auf die Zelle)?
JoelH
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Di 23.03.10 15:11 
setz im Exit des Edits einfach die Row und Col des Stringgrids.

_________________
mfg. Joel
bf109g.01 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84



BeitragVerfasst: Di 23.03.10 18:37 
user profile iconJoelH hat folgendes geschrieben Zum zitierten Posting springen:
setz im Exit des Edits einfach die Row und Col des Stringgrids.

Wie soll das bitte gehen?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm6.EPosxExit(Sender: TObject);
begin
  Acol:=StrToInt(EPosX.text)
end;
Acol ust doch dann keine bekannte Variable...

Edit: Habs schon, der Aufruf ist StringGrid.col:integer;
JoelH
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Di 23.03.10 21:09 
user profile iconbf109g.01 hat folgendes geschrieben:


Edit: Habs schon, der Aufruf ist StringGrid.col:integer;


Hast du endlich die Hilfe gefunden ;)

*SCNR*

_________________
mfg. Joel