Forum > General

Working with GUI again

(1/1)

captian jaster:
I have my MainMenu thingy on top and on it is contacts.
Click contacts the sub menu displays New And Open.
Im working with New Right Now.
So i have two forms. For the main menu and for the New Contact.
When i click on New i want it to open new contact. how would i do that

Leledumbo:
something like this:

--- Code: ---// Important for the main form to access TNewContactForm
uses
  FormNewContact; // FormNewContact is the unit that holds TNewContactForm
...
// MINew is your 'New' menu item
procedure MINewClick(Sender: TObject);
begin
  // TNewContactForm is your 'New Contact' form
  with TNewContactForm.Create(Self) do
    try
      // this will open the form as a modal dialog
      ShowModal;
    finally
      Free;
    end;
end;
...

--- End code ---

Navigation

[0] Message Index

Go to full version