Autor Beitrag
smilie128
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 48



BeitragVerfasst: Do 18.12.03 19:04 
hi

Folgendes Problem:
Ich benutze eine Form1 als Hauptprogramm und eine Form2 die versteckt gestartet wird.
Nun wird, wenn der Benutzer einen Button drückt, Form2 sichtbar gemacht und die Größe von Form1 wird so geändert, daß sie nicht mehr störrt. (bis hier alles kein Problem)
Jetzt möchte ich aber, daß Form2 unter allen Umständen vom OnShow bis zum OnHide Ereigniss im Vordergrund bleibt vor allen Fenstern. Komischerweise bleibt aber immer nur Form1 im Vordergrund wenn egal wo ich FormStyle auf fsStayOnTop setze.
Wie kann ich das ändern?

Danke im Vorraus (und für die Geduld bei meinen vielen Fragen diese Woche :) )

Mfg
smilie128


Zuletzt bearbeitet von smilie128 am Do 18.12.03 21:18, insgesamt 2-mal bearbeitet
blackbirdXXX

ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1077
Erhaltene Danke: 1

Ubuntu Dapper

BeitragVerfasst: Do 18.12.03 20:21 
Was hast du für eine Delphi Version? Bei mir ist es so wenn ich Form2 aus stayontop habe und Form1 auf normal ist das gewünschte Ergebnis da. Zeig mal deinen Quelltext. Vielleicht rufst du es falsch auf.

_________________
Klein, schwarz und ärgert Techniker? Jumper!
smilie128 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 48



BeitragVerfasst: Do 18.12.03 20:26 
hi

Benutze Delphi 6 Enterprise
Hier sind die beiden Prozeduren die StayOnTop bewirken sollen
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TLinkFeld.FormShow(Sender: TObject);
begin
  eMuleForm.ClientHeight := 0;
  LinkFeld.FormStyle := fsStayOnTop;
end;

procedure TLinkFeld.FormHide(Sender: TObject);
begin
  eMuleForm.ClientHeight := 582; // Haupt-Form
  LinkFeld.FormStyle := fsNormal    // Neben-Form
end;


Die Haupt-Form ist fsNormal.
Ich kann mir nicht vorstellen das man da sociel falsch machen kann.
Mfg
smilie128

Moderiert von user profile iconPeter Lustig: Code- durch Delphi-Tags ersetzt
blackbirdXXX

ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1077
Erhaltene Danke: 1

Ubuntu Dapper

BeitragVerfasst: Do 18.12.03 20:51 
Ich hab direkt beim erstellen das Fenster auf stayontop gestellt. Warum bitte machst du das Formular auf clienthight := 0?

_________________
Klein, schwarz und ärgert Techniker? Jumper!
smilie128 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 48



BeitragVerfasst: Do 18.12.03 21:03 
Das war ein Versuch. Ich hatte mir gedacht, wenn ich das Hauptfenster StayOnTop setze und klein mache, würde es funktionieren. Hat es aber auch nicht.Hätte mir auch gereicht geht aber nicht.

Das Fenster beim erstellen auf fsStayOnTop zu setzen funktioniert auch nicht es verschwindet trotzdem hinter andere.
Habs mitlerweile auch mit Timer-Aufruf und BringToFront versucht...geht auch nicht.

weist du noch ne andere möglichkeit?
Wenns geht ohne API oder ähnliches oder mit Code bin da nämlich nicht so bewandert.
smilie128 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 48



BeitragVerfasst: Do 18.12.03 21:18 
Ich nehme alles zurück was ich oben geschrieben habe mit Timer funktioniert es doch
(vorhin nicht mh.... merkwürdig :?: )

Alles bestens hier die allgemeine Lösung:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TForm2.FormShow(Sender: TObject);
begin
  Timer1.Enabled := TRUE;
end;

procedure TForm2.FormHide(Sender: TObject);
begin
  Timer1.Enabled := FALSE;
end;

procedure TForm2.Timer1Timer(Sender: TObject);
begin
  TForm2.BringToFront;
end;


Den Timer-interval habe ich auf 1 gesetzt und zusätzlich FormStyle := fsStayOnTop

Ich fress nen Besen. Seit fast 5 Stunden bastel ich immer wieder daran rum und jetzt geht´s :D

Besten Dank für Deine Hilfe

Gruß
smilie128

Moderiert von user profile iconPeter Lustig: Code- durch Delphi-Tags ersetzt