Autor Beitrag
Thunder00
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52



BeitragVerfasst: Fr 07.03.03 17:38 
Hallo,
Ich möchte in der Titelleiste meiner Form neben den Systembuttons (minimieren, maximieren, schliessen) noch einen Button hinbasteln.

Also dachte ich mir, das ich einfach ne 2te Form mache und die dann da oben hinsetze (Form dann Dialog=bsNone usw.).

Jetz muss natürlich wenn die Form1 bewegt wird, die Form2 hinterhergezoggen werden, damit der Button bzw. die Form2 an der richtigen Stelle (neben den Sysbuttons) bleibt??

Ich hab aber bei Form1 kein Ereigniss wie OnMove oder so gefunden...
und die andren (OnDragDrop usw.) funzen au net.

Wie kann ich das machen?
Danke im Voraus

_________________
If you can't make it good, at least make it looks good. (Bill Gates)
Tomac
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 113

Win XP
D6 Ent
BeitragVerfasst: Fr 07.03.03 17:56 
Warum denn so kompliziert?
Schau mal hier, eine einfache Komponente kann das auch, und schaut wahrscheinlich auch besser aus.
www.torry.net/otherbuttons.htm

mfG
Tomac
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Fr 07.03.03 23:09 
Per Komponente ist es sicherlich am besten, hie aber trotzdem der Code um Ereignisse beim Verschieben einer FOrm auszuführen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure tForm1.WndProc(var Message: TMessage);
begin
 if (Message.msg = WM_Move) then
 begin
  {Dein Code}
 end;
 inherited WndProc(Message);
end;


In den Public Teil deiner Unit kommt dann noch:
ausblenden Quelltext
1:
procedureWndProc(var Message: TMessage);					


das wars!

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Thunder00 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52



BeitragVerfasst: Sa 08.03.03 17:04 
Danke! Ich hoffe es klappt!

_________________
If you can't make it good, at least make it looks good. (Bill Gates)
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: Sa 08.03.03 17:13 
Guck mal auf der Seite:

home.pages.at/dbr-software/delphi

Da ist irgendwo ein Tip wie man sich selbst ein Button erstellt.

_________________
Popov
Thunder00 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52



BeitragVerfasst: Sa 08.03.03 20:13 
@GSE: Deine Methode funzt net.

_________________
If you can't make it good, at least make it looks good. (Bill Gates)
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: So 09.03.03 13:26 
Sorry, :oops:
der Eintrag in den Public-Teil muss so aussehen:
ausblenden Quelltext
1:
procedure WndProc(var Message: TMessage);override;					


mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
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: So 09.03.03 14:35 
@GSE

Bist du dir sicher, daß es das ist was er will. So wie ich verstanden habe will er einen weiteren Button in der Titelleiste. Ok, der hat auch nach OnMove gefragt, aber es ist vertane Mühe. Der Button wird mit einer Verzögerung hinterherlaufen. Man wird also sehr gut sehen können, daß es ein eigenständiges Formular ist.

@Thunder00

Hast du dir die Seite von DBR angeguckt? Da ist genau beschreiben wie man einen Button in die Titelleiste setzt. Vor allem ist es professionel und du kannst im gleichen Formular auf die Evens reagieren und nicht mit Umweg über ein anderes Formular.

_________________
Popov
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: So 09.03.03 15:25 
GSE hat folgendes geschrieben:
Per Komponente ist es sicherlich am besten, hier aber trotzdem der Code um Ereignisse beim Verschieben einer Form auszuführen:


@Popov: Ich habe also durchaus erkannt, dass es per Komponente besser ist, wollte ihm aber auch den Code für WM_Move mal zeigen(falls er ihn früher oder später doch mal braucht)

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
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: So 09.03.03 16:10 
Mit dem DBR Tip meinte ich keine Komponente. Auf der Seite ist ein Tip mit dem gezeigt wird wie man einen Button auf der Titelleiste zeichen kann. Beim Klick auf die Button-Grafik verhält sich diese wie ein sonstiger Button und geht runter. Es wird also der klein Bereich auf OnMove und OnClick überwacht. Im Grunde genommen macht es Windows auch nicht anders.

Es ist also alles Komponentenfrei.

_________________
Popov
Thunder00 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52



BeitragVerfasst: So 09.03.03 22:15 
Hallo,

Ich habe auf der DPR-Site noch andre geile Codes gefunden.

Das mit dem Button habe ich auch gefunden.
Da kann man leider nur ne kleine Bitmap in den Button tun.

Nachdem ich den Admin angeschrieben habe, hat er jetzt den Code so geändert, das man auch eine Caption eingeben kann...

DAS IS JETZT PERFEKT!!!

Ich muss nurnoch probieren, ob ich das auch im XP-Stil hinkriege.

Ich wollt ja eigentlich n blauen Button wie unter XP das Design aussieht. Aber so ist es auch schon geil.

VIELEN DANK AN ALLE DIE SICH SO DARM BEMÜHT HABEN MIR ZU HELFEN !

_________________
If you can't make it good, at least make it looks good. (Bill Gates)
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: So 09.03.03 23:11 
Immer gern zu Diensten ;)

_________________
Popov