Autor Beitrag
G-man
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 258

Win 2000, Win ME, SuSE 8.2
D5 Standard, D6 Professional
BeitragVerfasst: Do 05.06.03 08:21 
Moin,
ich will herausfinden, welche Zeile aus einem Stringgrid gerade der User bearbeitet und in einem Label die Länge des betreffenden Strings (den der User eingibt) anzeigen.
Wie realisiere ich das?

G-man

_________________
...To err is human, but to really foul things up requires a computer.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 05.06.03 08:38 
So:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.StringGrid1KeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  with StringGrid1 do
    label1.caption:=IntToStr(Length(Cells[Col,Row]));
end;


Denn (um den ersten Teil Deiner Frage nochmal gesondert zu beantwrten):
StringGrid1.Row gibt Dir die aktuell markierte Zeile aus.

MfG,
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
G-man Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 258

Win 2000, Win ME, SuSE 8.2
D5 Standard, D6 Professional
BeitragVerfasst: Fr 06.06.03 10:56 
Vielen Dank,
das das so einfach geht hätte ich nicht gedacht...

_________________
...To err is human, but to really foul things up requires a computer.