InputBox and other sub-forms don't close lazarus / 31-LCL ---------------------------------------------------------------------- Iede · 2011-05-16 16:06 I have a program in which I'm using inputboxes. When the inputbox opens, I'm able to key in a value, but after clicking Ok or Cancel the inputbox doesn't close and the program doesn't react to anything anymore: it has to be killed from the task list. Part of the code is: var rstr: String; begin   rstr:= InputBox('Simulation', 'Reference-car', IntToStr(ReferenceCar));   try     ReferenceCar := StrToInt(rstr);     if (ReferenceCar < 1) or (ReferenceCar > nVehicles) then       ReferenceCar := 1;     MyIniFile.WriteInteger('Settings', 'ReferenceCar', ReferenceCar)   except     on E: EConvertError do       ShowMessage(E.ClassName + CRLF + E.Message)   end end; The same happens also for other forms which are opened inside the main form. Any idea what's wrong? ---------------------------------------------------------------------- eny · 2011-05-16 16:44 Quote from: Iede on May 16, 2011, 06:06:02 pmPart of the code is: Part of the answer: it all works OK for me. ---------------------------------------------------------------------- Iede · 2011-05-16 17:59 That's the "funny" thing, I have programs (most trivial ones) where the above works fine, and some (non-trivial) programs where it doesn't. Could it be a compiler setting and if so, how could I check this? ---------------------------------------------------------------------- eny · 2011-05-16 19:33 What I meant to say was: there is nothing wrong with the isolated code fragment so that is not the problem (I hope, or else there might be a problem with Lazarus or FPC). The problem most likely lies somewhere else. My crystal ball came up with: are you using threads? Any (form) code in dll's? Other events like timers that interrupt the normal message flow? etc. ---------------------------------------------------------------------- Iede · 2011-05-16 21:11 No, nothing of these... Oops  there was a timer running and not disabled while opening the inputbox. I disabled it before the inputbox and now it works ok. Thanks a lot!!!