Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
Open a second form/window
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
AI assisted translation o...
by
MathMan
[
Today
at 12:55:30 am]
DataPort or Synpase stat...
by
eldonfsr
[April 16, 2026, 11:32:18 pm]
Ann: Deinline: a de-inlin...
by
LeP
[April 16, 2026, 11:27:18 pm]
[FPC 3.2.4, Windows] PTC ...
by
Fred vS
[April 16, 2026, 08:26:24 pm]
I hope FreePascal can sup...
by
Martin_fr
[April 16, 2026, 08:11:42 pm]
Cannot build Units for Si...
by
NormanDunbar
[April 16, 2026, 07:39:07 pm]
IDE: Property editor does...
by
dsiders
[April 16, 2026, 07:04:22 pm]
What is wrong with this c...
by
OH1KH
[April 16, 2026, 04:32:48 pm]
FPC Unleashed (inline var...
by
LeP
[April 16, 2026, 04:22:24 pm]
Delimited text - how find...
by
Aruna
[April 16, 2026, 04:02:11 pm]
[work arounded]Naming dae...
by
LeP
[April 16, 2026, 03:36:10 pm]
Lazarus Bugfix Release 4....
by
Jonax
[April 16, 2026, 03:06:25 pm]
Error: Compilation raised...
by
janasoft
[April 16, 2026, 02:29:19 pm]
CudaText editor (written ...
by
AlexTP
[April 16, 2026, 10:43:12 am]
C header function with on...
by
440bx
[April 16, 2026, 09:13:38 am]
(Solved)TUpDown KeyDown ...
by
LeP
[April 15, 2026, 11:21:09 pm]
Zipper: Addition of mult...
by
marcov
[April 15, 2026, 10:35:15 pm]
Seeking advice on setting...
by
gidesa
[April 15, 2026, 07:02:04 pm]
GTK3: FillRect() mispaint...
by
baldzhang
[April 15, 2026, 06:32:52 pm]
Lazarus Image Editor
by
Paolo
[April 15, 2026, 05:37:30 pm]
Ann: DeCoperators
by
Thaddy
[April 15, 2026, 01:29:40 pm]
RunFormula: math expressi...
by
Handoko
[April 15, 2026, 01:24:30 pm]
How to merge multiple cla...
by
cdbc
[April 15, 2026, 12:48:42 pm]
PWM signals, atmega328p, ...
by
pascalbythree
[April 15, 2026, 12:39:25 pm]
Remote desktop software i...
by
creaothceann
[April 15, 2026, 10:09:49 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Open a second form/window (Read 14211 times)
Pascaluvr
Full Member
Posts: 216
Open a second form/window
«
on:
October 23, 2011, 10:39:16 am »
Sorry, newbie to lazarus here.
I have managed to run a basic program, but now, on the click of a button I want to open a second (modal) window. Help would be appreciated'
Thanks in advance
Logged
Windows 7, Lazarus 1.0.8, FPC 2.6.2, SQLite 3
Avishai
Hero Member
Posts: 1021
Re: Open a second form/window
«
Reply #1 on:
October 23, 2011, 10:43:18 am »
First, you must add the Second Form unit to the Calling unit 'Uses' statement. Then add 'Form2.ShowModal;' to the button OnClick event.
Example:
Form1 is Unit1 and Form2 is Unit2
Add Unit2 to the 'Uses' statement of Unit1
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.ShowModal;
end;
«
Last Edit: October 23, 2011, 10:51:35 am by Avishai
»
Logged
Lazarus Trunk / fpc 2.6.2 / Win32
Pascaluvr
Full Member
Posts: 216
Re: Open a second form/window
«
Reply #2 on:
October 24, 2011, 01:41:13 am »
Great... thanks Avishai. I looked everywhere to find how to do that... so simple when you know:)
Thanks again.
Logged
Windows 7, Lazarus 1.0.8, FPC 2.6.2, SQLite 3
Avishai
Hero Member
Posts: 1021
Re: Open a second form/window
«
Reply #3 on:
October 24, 2011, 01:43:19 am »
Almost everything is simple once you know how
It's finding out how that is hard.
Logged
Lazarus Trunk / fpc 2.6.2 / Win32
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
Open a second form/window
TinyPortal
© 2005-2018