In short, in delphi I check what is written in stringgrid.cells and, if necessary, delete the characters. I do this immediately when you enter text. When editing, I first insert the text into a variable, which I later work with, and at the end I insert the removable variable into the stringgrig. The problem is that when pressed, the entire text is highlighted and when pressed again it is replaced, which is not gud. That is, after each character you have to press the arrow to the right, for example. How to make it not beat? Is it possible to somehow initialize pressing the same arrow to the right automatically?
procedure TForm1.StringGrid1SetEditText(Sender: TObject; ACol, ARow: Integer; const Value: String); var i, d:integer; s:string; begin s:=stringgrid1.cells[acol,arow]; d:=length(s); if (acol=2) and (d>0) then begin if s[d]='.' then s[d]:=','; if (ord(s[d])<48) or (ord(s[d])>57) then delete(s,d,1); stringgrid1.cells[acol,arow]:=s; end; end;
Valuevalue. I only get if (aCol = 1) and (aRow = 1) then Value: = '00000; 1; '; - user31328