Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Focus on Form (https://www.delphipraxis.net/75705-focus-form.html)

sk.Silvia 23. Aug 2006 20:11


Focus on Form
 
hi there, i have 2 forms, which are both visible, but when the program starts, i want to have the 2 form which is smaller and hidden behind the 1 form, to have it infront of form 1

the Form2.SetFocus didnt worked out...:( how can i do this?

mkinzler 23. Aug 2006 20:19

Re: Focus on Form
 
.BringToFront or open it via .ShowModal.

Balu der Bär 23. Aug 2006 20:19

Re: Focus on Form
 
Have you already tried a simple Form2.BringToFront? :gruebel:

sk.Silvia 23. Aug 2006 20:44

Re: Focus on Form
 
jup! but it isnt working, it is working when i give an onpress procedure and there Form2.BringToFront
but
when i give it to the OnCreate (or to Form1 or Form2), it dont works, i need to that it brings itself without a users action (press button etc)

mkinzler 23. Aug 2006 20:45

Re: Focus on Form
 
Also tried in the Main-Loop (dpr)?

sk.Silvia 23. Aug 2006 21:01

Re: Focus on Form
 
whats main loop? google didnt help:/

mkinzler 23. Aug 2006 21:12

Re: Focus on Form
 
The main-loop can be found in the Project-Source:

Delphi-Quellcode:
program Test;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Form2.Show;
  Form2.BringToFront;
  Application.Run;
end.


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:54 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz