Autor Beitrag
zuwanachloe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23

Win 98, Win ME, Win 2000, Win XP, Win Vista
D 7 Enterprise
BeitragVerfasst: Do 07.09.06 21:05 
Hey
hätt da ma ne Frage hat wer ne Idee wie man das machen kann das man über eine Button o.ä. einstellen kann, dass die Form entweder immer im Vordergrund oder halt nicht im Vordergrund ist?
Hab das bis jetzt noch nicht hinbekommen...
danke schonmal im vorraus
MfG
ZuWaNaChLö
cuejo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 142

Win XP
Delphi 7 Personal und 2005 PE
BeitragVerfasst: Do 07.09.06 21:14 
Das ist ganz einfach :roll: :
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.FormStyle:=fsStayOnTop;
end;

_________________
Computer sind dumm, aber fleißig. Deshalb arbeite ich so gerne damit.
zuwanachloe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23

Win 98, Win ME, Win 2000, Win XP, Win Vista
D 7 Enterprise
BeitragVerfasst: Sa 09.09.06 16:04 
ja so hab ich das ja och schon probiert aba bei mir hat so nich funktioniert... aba ich werd das ma nochma probieren...
danke
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 09.09.06 16:11 
FormStyle sollte zur Laufzeit nicht geändert werden. Hängt wohl damit zusammen, dass dann das Fenster neu erstellt wird und somit ein neues Handle bekommt, was zu Komplikationen führen kann. Besser ist es so:

ausblenden Delphi-Quelltext
1:
SetWindowPos(Form1.Handle,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE+SWP_NOMOVE);					

_________________
We are, we were and will not be.
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 04.01.07 13:09 
user profile iconGausi hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
SetWindowPos(Form1.Handle,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE+SWP_NOMOVE);					

Ich verstehe nicht, warum Gausi SWP_NOSIZE und SWP_NOMOVE mit + verknüpft und nicht mit or.
Offenbar ist es richtig so wie es Gausi gemacht hat, weils ja funktioniert. Aber sonst werden doch solche Attribute immer mit Oder verknüpft?
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 04.01.07 13:14 
Da die unterschiedlichen Flags dort immer glatte Zweierpotenzen sind (sind es doch, oder? Sonst könnte man mehrere Flags ja nicht wieder auseinanderfriemeln), ist eine Addition hier dasselbe wie ein bitweises or.

_________________
We are, we were and will not be.
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 04.01.07 13:31 
Aber da kommt doch nicht das gleiche raus, wenn ich zb.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
  101100
or011011
  ------
  111111

  101100
+ 011011
  ------
 1000111
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 04.01.07 13:36 
user profile iconGausi hat folgendes geschrieben:
Da die unterschiedlichen Flags dort immer glatte Zweierpotenzen sind ...

1100101 und 0011010 sind keine Zweierpotenzen. Die sehen binär so aus: 1, 10, 100, 1000, 10000, 100000. Und solange alle verschieden sind und nicht doppelt vorkommen, kann man die mit Or oder + verknüpfen, und das Ergebnis bleibt gleich.

Aber du hast recht. Besser wäre Or.

_________________
We are, we were and will not be.
Logikmensch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 390

Win XP
Delphi 2007 Prof., XE2, XE5
BeitragVerfasst: Do 04.01.07 13:58 
Laut Msdn muss OR verwendet werden. Wenn es wirklich keine Zweierpotenzen sein sollten, kommen durch + sogar falsche Werte bzw. Einstellungen heraus.

_________________
Es gibt keine Probleme - nur Lösungen!
Reinhard Kern
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 591
Erhaltene Danke: 14



BeitragVerfasst: Do 04.01.07 18:17 
user profile iconLogikmensch hat folgendes geschrieben:
Laut Msdn muss OR verwendet werden. Wenn es wirklich keine Zweierpotenzen sein sollten, kommen durch + sogar falsche Werte bzw. Einstellungen heraus.


Hallo, noch viel schlimmer: wenn der Wert schon gesetzt ist, änderst du das Bit links davon...

Gruss Reinhard
Logikmensch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 390

Win XP
Delphi 2007 Prof., XE2, XE5
BeitragVerfasst: Fr 05.01.07 06:39 
Zitat:
Hallo, noch viel schlimmer: wenn der Wert schon gesetzt ist, änderst du das Bit links davon...


Na sag' ich doch... :)

_________________
Es gibt keine Probleme - nur Lösungen!