[SOLVED] Disable a button when inside click event handler=BOOM?!?! lazarus / 31-LCL ---------------------------------------------------------------------- BigChimp · 2012-01-29 13:43 Hi, When coding an event handler for a button click handler, I called another procedure at the end that set the enabled properties of some controls including the button control to false. This crashed my application (Win32, Lazarus SVN today, FPC fixes2.6 today). Is this a question of PEBKAC/PICNIC/operator error or a problem with the LCL? Thanks ---------------------------------------------------------------------- User137 · 2012-01-29 14:20 I cannot replicate the crashing. There could be something specific going on in your application. Code: [Select]procedure TForm1.Button1Click(Sender: TObject); begin   Test; end; procedure TForm1.Test; begin   button1.Enabled:=false;   button2.Enabled:=false;   button3.Enabled:=false;   button4.Enabled:=false; end; ---------------------------------------------------------------------- Blaazen · 2012-01-29 14:20 If I put Button on my Form, I can do: Code: [Select]procedure TForm4.Button2Click(Sender: TObject); begin   Button2.Enabled:=False; end; It works, no crash. Lazarus + Qt, Linux. So it does not seem to be the LCL problem. Are you able to reproduce with such simple example ? ---------------------------------------------------------------------- BigChimp · 2012-01-29 17:09 Thanks all, couldn't reproduce with a simple example.