Show form2 from form1 lazarus / 31-LCL ---------------------------------------------------------------------- amedeo · 2023-11-07 11:52 Hallo after some time I want to write a new program for my DB Music and so I create a new program and e new main-form ... in new Lazarus 3RC. From main-form by a Button, I open form2 (created before by "New Form") using Form2.Show. The problem is that main-form do not see Form2 and Form2.show do not works. I tried using Linux Mint, Linux Elementary, Windows 7 and 10 and I have the same situation ... ergo I'm doing it wrong and I am stupid I'll go crazy if I do not understand why because my stupidity.  Somebody can save my mental health. Sorry for a so trivial question. Thanks in advance. Amedeo ---------------------------------------------------------------------- dbannon · 2023-11-07 12:05 No, you are definitely not stupid. Just uninformed at this stage. Generally, you will have a mention of the unit that Form2 lives in in Unit1's uses clause. So, assuming Form1 is in Unit1 and form2 is in Unit2 - In Unit1 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses blar, blar, Unit2; That way, code in Unit1 knows about Form2 (declared in Unit2) and can make calls like Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Form2.Show(); Davo ---------------------------------------------------------------------- TRon · 2023-11-07 13:14 Quote from: dbannon on November 07, 2023, 01:05:46 pmThat way, code in Unit1 knows about Form2 (declared in Unit2) and can make calls like To which I would like to add that you can (only) do that when Form2 is created and therefor exist. By default forms are created automatically (unless that was changed in project settings) in successive order so Form2 might not actually be (auto-)created yet when you try to access it. That usually ends up with an access violation error. ---------------------------------------------------------------------- amedeo · 2023-11-07 15:30 Thanks, it works but It's safe I am stupid because I did not understand  Thanks again Amedeo