Autor Beitrag
HBriele
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80



BeitragVerfasst: Mi 26.10.05 22:35 
Hallo,
ich möchte folgende Funktion in ein Stringgrid einbauen und zwar
wenn ein Stringgrid gefüllt ist und man einen Buchstaben drückt so soll der Cursor
an den ersten Eintrag im Grid springen und beim druck einer neuen Taste weiter zum
Eintrag der gedrückten Taste.
Frage, gibt es da etwas?
Oder hat da jemand einen Tipp oder eventuell eine Funktion.
Wäre Super.

Gruß
hb
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 27.10.05 00:17 
Moin!

IMHO gibt´s da nix fertiges, OnKeyPress() und selber suchen... :wink:

cu
Narses
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Do 27.10.05 02:22 
(fast) Pseudocode :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
var gefunden : boolean;
    AktRow : integer; // festhalten, falls kein Ergebnis
begin
  ende := false;
  gefunden := false;
  AktRow := sg.Row;
  sg.Row := 1;
  while not gefunden and not ende do begin
    gefunden := copy (sg.Cells [Apalte,sg.Row],1,1) = Buchstabe;
    sg.Row := sg.Row + 1;
    ende := (sg.Row = sg.Rowcount) 
  end;
  if not gefunden then
    sg.Row := AktRow; // an Ausgangspunkt zurückkeheren


Ja, und dann mit length (sg.Cells[bla,bla]) so weiter ... :mrgreen:

_________________
Gruß
Hansa