What after showModal Form gets closed lazarus / 39-Graphics ---------------------------------------------------------------------- Weitentaaal · 2020-10-29 15:25 Hey Guys, Just a short Question: So this is a part of  my code 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         ZubAll.ShowModal;        If ZubAll.Sprung.Caption = 'ABB' Then Begin         calculated := False;           Break;        End;  it is calling a Normal Form where i imediately press Abort (its a Button) to get back (its a form where i can select extras for my produkt) this is the code of the button: 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 procedure TZubAll.Command1_Click(Sender: TObject);begin  Sprung.Caption:= 'ABB';  //TODO ErrorHandling  //TODO Close DB Connections (Werte + Texte)  ZubAll.Hide;end;  My problem is that after this code nothing happens. Do i have to call main Form again ? but how will i get to this point in my code where i called the second Form ? i dont get it how i get back to the part i was calling ShowModal after i exit this form. Please some Help i am very Newbie to Lazarus sorry thanks ---------------------------------------------------------------------- circular · 2020-10-29 16:46 You need to call Close. Or even better set the ModalResult value. Then you will get this value when calling ShowModal. ---------------------------------------------------------------------- lucamar · 2020-10-29 17:31 Calling Hide makes the form "disssapear" but it's still there, and since it is shown modally the focus can't return to the caller. As Circular says, you have to close the modal form either calling Close or, which is better, setting its ModalResult which incidentally also closes it. By the way, you should check the result of ShowModal to allow for the user closing the form without doing anything or clicking a "cancel" button or similar: 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         if (ZubAll.ShowModal = mrOK) {or mrYes or whatever}        and (ZubAll.Sprung.Caption = 'ABB') Then Begin           calculated := False;           Break;        End; ---------------------------------------------------------------------- Weitentaaal · 2020-10-30 07:09 Thanks Guys