* * *

Author Topic: [SOLVED] Exception Class error on Checkbox  (Read 472 times)

Bazzao

  • Full Member
  • ***
  • Posts: 106
  • Pies are squared.
[SOLVED] Exception Class error on Checkbox
« on: August 31, 2017, 01:29:28 am »
Under Delphi, creating a checkbox was easy.

I get an Exception Class error if I click in the checkbox ...

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
  with CheckBox1 do
    begin
      Checked:=not Checked;
    end;
end;

Bazza
« Last Edit: September 09, 2017, 06:53:14 am by Bazzao »
Bazza

Lazarus 1.6.4 r54278 FPC 3.0.2 x86_64-win64-win32/win64
Windows 10, 7.

Blaazen

  • Hero Member
  • *****
  • Posts: 2391
  • POKE 54296,15
    • Eye-Candy Controls
Re: Exception Class error on Checkbox
« Reply #1 on: August 31, 2017, 02:03:29 am »
What do you try to achieve? Checkbox changes its state automatically when clicked, your code will cause unchangeble checkbox. Even more, changing state triggers OnClick event, therefore your code causes endless loop.
Lazarus 1.9.0 r55743 FPC 3.0.2 x86_64-linux-qt Chakra, Qt 4.8.7, Plasma 5.9.4
Lazarus 1.6.4 r54278 FPC 3.0.2 i386-win32-win32/win64 Wine 2.4

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Bazzao

  • Full Member
  • ***
  • Posts: 106
  • Pies are squared.
Re: Exception Class error on Checkbox
« Reply #2 on: August 31, 2017, 08:43:41 am »
Well how improved is that!

In old Dephi (acquired last century), you had to check it yourself -- hence the code.

I should think more in the future than in the past and forget what I learned all those years ago.

Many thanks Blaazen.

Bazza

Lazarus 1.6.4 r54278 FPC 3.0.2 x86_64-win64-win32/win64
Windows 10, 7.

Thaddy

  • Hero Member
  • *****
  • Posts: 4629
Re: Exception Class error on Checkbox
« Reply #3 on: August 31, 2017, 09:13:40 am »
Welllllll NO. Just tested D2 because I was curious....
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus