Newbie to LCL lazarus / 31-LCL ---------------------------------------------------------------------- tcltkdev · 2012-03-07 02:02 Hi, I'm trying to migrate existing programs in PowerBuilder to Lazarus and I'm having so much trouble. I care barely make the examples I found here in the forum to work. I created two forms. When I ran the program both forms are opened and I only want one form to be opened. I have a button on form A that opens form B. So I tried hiding form b at runtime. And it gets complicated after that. But when form B is close my program crashes. In Powerbuilder the form is only open when called explicitly. if NOT IsValid( MyFormB ) then // Check if it's already opened    Open( MyFormB ) end if Event CloseClicked     Close( MyFormB )     // Close( Parent ) // Another way of closing the form event end I'm trying to convert the code above into lazarus/fp but I just can't get it right. Is there any tutorial on GUI programming in Lazarus that discuss basic stuff like I illustrated above. I need to show to my boss that there is an economical alternative to commercial software. Please help. ---------------------------------------------------------------------- IPguy · 2012-03-07 03:04 How are you calling form B?  Is there an explicit formB.show in your startup code? When I do something similar, only the first form I create shows up automatically.  I have to do a formB.show (or .showmodal, depending on my needs) to get the 2nd form to show up. ---------------------------------------------------------------------- tcltkdev · 2012-03-07 03:19 Quote from: IPguy on March 07, 2012, 04:04:27 amHow are you calling form B?  Is there an explicit formB.show in your startup code? When I do something similar, only the first form I create shows up automatically.  I have to do a formB.show (or .showmodal, depending on my needs) to get the 2nd form to show up. I just created a new project and only one form now is showing. I still want to know how open & close form in lazarus. Can someone point me to a nice example. Thanks. ---------------------------------------------------------------------- joseme · 2012-03-07 03:40 Your app can have many forms, but you decide which ones are created on start. You should open the menu Project/Project Options/Forms item, you should see two listboxes, the left one contains the forms that will be created on start. ---------------------------------------------------------------------- tcltkdev · 2012-03-07 06:19 Quote from: joseme on March 07, 2012, 04:40:01 amYour app can have many forms, but you decide which ones are created on start. You should open the menu Project/Project Options/Forms item, you should see two listboxes, the left one contains the forms that will be created on start. Thanks. I finally starting to understand how stuff works with Lazarus/FPC.