Autor Beitrag
Popov
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1655
Erhaltene Danke: 13

WinXP Prof.
Bei Kleinigkeiten D3Pro, bei größeren Sachen D6Pro oder D7
BeitragVerfasst: Di 01.04.03 17:01 
Ich hab follgendes Problem: Ich hab ein Formular, das immer OnTop sein soll. Weiterhin hab ich ein zweites Formular das immer OnTop über dem Ersten sein soll. Und hier fangen die Probleme an. Sind beide OnTop gestellt, dann wechseln die sich im Vordegrung ab. Ist nur das Zweite on Top, dann wird das erste von anderen Fenstern verdeckt.

Natürlich kann ich mit einem Timer mein zweites Fenster immer nach vorne schicken, aber das ist nicht die feine Art.

Ich suche also eine Lösung die keine Notlösung ist.

_________________
Popov
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Di 01.04.03 17:12 
Eigentlich ist es ja so, dass nur, wenn das erste aktiviert wird, also OnActivate, das zweite in den Hintergrund rutscht. Dann könntest Du doch in diesem Ereignis Form2.BringToFront machen, oder nicht?

//Nachtrag: OK, vergiss es, hab was nicht bedacht, ich forsche grad mal
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mi 02.04.03 07:43 
Nim dem Formular, das zwar OnTop, aber unterhalb des anderen Formular sein soll im OnActivate den OnTop-Status weg und gib ihn ihm wieder im OnDeactivate. Ich würde hier allerdings nicht die Eigenschaft fsStayOnTop verwenden, da diese hier ein bisschen zu unflexibel ist. Nimm stattdessen direkt die API-Funktion SetWindowPos().

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 05.04.03 01:15 
Hi,

wenn du das hinbekomme hast, sag mir mal bitte wie du es gemacht hast.. stehe grad vor demselben problem :)

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 05.04.03 04:19 
Motzi hat folgendes geschrieben:
Ich würde hier allerdings nicht die Eigenschaft fsStayOnTop verwenden, da diese hier ein bisschen zu unflexibel ist. Nimm stattdessen direkt die API-Funktion SetWindowPos().

Nicht unflexible. Ich darf mal zitieren:
Zitat:

Note: It is not advisable to change FormStyle at runtime.