« on: December 10, 2019, 02:40:34 pm »
Dear ALL,
How do I disable a CheckListBox, so that a user cannot change the state of each box?
I tried this:
procedure TMainForm.StatesListBoxMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Abort;
end;
and this:
procedure TMainForm.StatesListBoxKeyPress(Sender: TObject; var Key: char);
begin
if (Key = #13) or (Key = #32) then Abort;
end;
but none of them worked.
Setting
CheckListBox1.Enabled := False;
is not a good solution either because (at least under Windows, not tested under Linux) it displays the checklist in gray and the scrollbars are also disabled.
« Last Edit: December 10, 2019, 03:28:16 pm by maurobio »
Logged
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 2.0.12 - FPC 3.2.0 on GNU/Linux Mint 19.1, Lubuntu 18.04, Windows XP SP3, Windows 7 Professional, Windows 10 Home