Como definir o maxlength de uma celular em um StringGrid

Delphi

09/06/2004

Existe alguma opção onde eu possa definir o maxlength de uma celula de um stringgrid?








[color=red:c4d78e21a7]Título alterado pelo Moderador oTTo.[/color:c4d78e21a7]


Marcela

Marcela

Curtidas 0

Respostas

Lucas Silva

Lucas Silva

09/06/2004

tem que ser a mão mesmo.
Tenta o código ai...

procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);
begin
   if (StringGrid1.Col = 0) and (StringGrid1.Row = 1) then
    if Length(StringGrid1.Cells[0,1]) = 2 then
     Key := 0;
end;



GOSTEI 0
POSTAR