Jump to content

jovenbarola

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About jovenbarola

  • Birthday June 7

Technical Information

  • Delphi-Version
    Delphi 12 Athens
  1. jovenbarola

    How to open form2 then close form1

    Thank you all for response. This the code work for me now, By showing it modally procedure TForm1.Button1Click(Sender: TObject); begin Self.Hide; // Create Form2 and pass value Form2 := TForm2.Create(nil); Form2.ReceivedValue := TButton(Sender).Caption; // Passing value Form2.Position := poScreenCenter; Form2.ShowModal; //ModalResult := mrCancel; if form2.ModalResult <> mrOk then Show; end;
  2. jovenbarola

    How to open form2 then close form1

    Hello, May I seek help on how to accomplish this, (I'm a beginner studying delphi) My startup is form1 I want to Open form2, then closing current form (form1)? Then I want to pass variable or some string parameter to form2? Here is my current code, it show form2, but it doesnt close immediatly the form1 procedure TForm1.Button1Click(Sender: TObject); begin Form2 := TForm2.Create(nil); try Form2.ShowModal; finally Form2.Free; Form1.Release; end; end; Thanks in advance
×