Recent

Author Topic: Keyboard not allowed in a specified cell of StringGrid  (Read 3852 times)

asdf

  • Sr. Member
  • ****
  • Posts: 310
Keyboard not allowed in a specified cell of StringGrid
« on: December 24, 2010, 04:44:00 am »
StringGrid1.Options:=StringGrid1.Options+[goEditing];

How can I protect a specified cell from entering data by using keyboard ?
Lazarus 1.2.4 / Win 32 / THAILAND

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Keyboard not allowed in a specified cell of StringGrid
« Reply #1 on: December 24, 2010, 01:59:33 pm »
Code: [Select]
procedure TForm1.StringGrid1SelectCell(Sender: TObject; aCol, aRow: Integer;
  var CanSelect: Boolean);
begin
  if (aCol = 1) and (aRow = 1) then
    CanSelect := False;
end;

 

TinyPortal © 2005-2018