User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 423,955 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,179 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser: Programming Forums
Views: 2171 | Replies: 4
Reply
Join Date: Feb 2007
Posts: 10
Reputation: dragoshstoica is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dragoshstoica dragoshstoica is offline Offline
Newbie Poster

Help 2 forms

  #1  
Feb 17th, 2007
Hi I'm a beginner in Delphi and I have I big problem
I don't know how to close a form
I've a form with user and password .After verification I enter on other form.Albeit I put form1.close when I minimize form2 , form1 it on the screen and i would like to disapear but i don't know how.
Helppp.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2007
Posts: 1
Reputation: manderton is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
manderton manderton is offline Offline
Newbie Poster

Help Re: 2 forms

  #2  
Feb 18th, 2007
To make a form invisible, you have to alter the booelan value of its 'VISIBLE' property.

To do this, you need the following assignment:
 
Form1.Visible := FALSE;
Form2.Visible := TRUE;
Form1 being the form name of the form you wish to close, and Form2 being the name of the form you wish to open.
Last edited by manderton : Feb 18th, 2007 at 9:43 am.
Reply With Quote  
Join Date: Feb 2007
Posts: 10
Reputation: dragoshstoica is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dragoshstoica dragoshstoica is offline Offline
Newbie Poster

Re: 2 forms

  #3  
Feb 19th, 2007
Thank's for help.
Reply With Quote  
Join Date: Dec 2006
Location: Romania
Posts: 171
Reputation: radu84 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 16
radu84 radu84 is offline Offline
Junior Poster

Re: 2 forms

  #4  
Feb 19th, 2007
here is another way to do what you want(MDI Childs):

1. you create another form(probably Form2 in Unit2.pas)
2. in the dpr file of your project delphi will insert another line WHICH must be deleted:
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1); { <-- This line is required DO NOT DELETE IT }
  Application.CreateForm(TForm2, Form2); { <-- This line will be deleted }
  Application.Run;
end.
3.in the unit where you want to open the window it must be used the name of the window in the "implementation"section
 implementation
    uses Unit2;
4.in the onclick() event of the button which will open the window you must put the following code
 form: TForm2;
begin
 form:=TForm2.Create(Self);
 form.ShowModal;
 form.Free;
end;
5. this is all about a simple application with 2 windows
Reply With Quote  
Join Date: Feb 2007
Posts: 10
Reputation: dragoshstoica is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dragoshstoica dragoshstoica is offline Offline
Newbie Poster

Re: 2 forms

  #5  
Feb 19th, 2007
Thank's for help.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Pascal and Delphi Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Pascal and Delphi Forum

All times are GMT -4. The time now is 6:21 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC