![]() |
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? |
Re: Focus on Form
.BringToFront or open it via .ShowModal.
|
Re: Focus on Form
Have you already tried a simple Form2.BringToFront? :gruebel:
|
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) |
Re: Focus on Form
Also tried in the Main-Loop (dpr)?
|
Re: Focus on Form
whats main loop? google didnt help:/
|
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 14:02 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz