Recent

Author Topic: Working with GUI again  (Read 3487 times)

captian jaster

  • Guest
Working with GUI again
« on: May 07, 2010, 03:54:04 pm »
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

  • Hero Member
  • *****
  • Posts: 8776
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Working with GUI again
« Reply #1 on: May 10, 2010, 03:27:31 am »
something like this:
Code: [Select]
// 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;
...

 

TinyPortal © 2005-2018