![]() |
Transparentes Formular, sichtbare controls
Hi!
Lange hab ich nach einem Codeschnipsel gesucht, der das Formular selbst unsichtbar macht, aber alle Controls (Images, Buttons, Labels...) sichtbar bleiben. Nun hab ich einen gefunden, das Problem ist nur, dass oben ein Stück sichtbar bleibt. Woran kann das liegen? Hat jemand eine ähnliche Prozedur? Danke schonmal! Lamy
Delphi-Quellcode:
procedure TForm2.Button1Click(Sender: TObject);
Var frmRegion, tempRegion: HRGN; i: Integer; Arect: TRect; Begin frmRegion := 0; For I:= 0 To ControlCount - 1 Do Begin // create a region for the control aRect := Controls[i].BoundsRect; // coordinates have to be window-relative, not client area relative OffsetRect( aRect, clientorigin.x - left, clientorigin.y - top ); tempRegion := CreateRectRgnIndirect( aRect ); // merge the region with the "summary" region we are building If frmRegion = 0 Then frmRegion := tempRegion Else Begin CombineRgn( frmRegion, frmRegion, tempRegion, RGN_OR ); DeleteObject( tempRegion ); End; End; // create a region for the caption and menu bar and add it to the // summary tempregion := CreateRectRgn( 0, 0, Width, GetSystemMetrics( SM_CYCAPTION )+ GetSystemMetrics( SM_CYSIZEFRAME )+ GetSystemMetrics( SM_CYMENU )); CombineRgn( frmRegion, frmRegion, tempRegion, RGN_OR ); DeleteObject( tempRegion ); SetWindowRgn( handle, frmRegion, true ); end; |
Re: Transparentes Formular, sichtbare controls
Kann mir denn keiner helfen? :-(
Jaschu |
Re: Transparentes Formular, sichtbare controls
|
Re: Transparentes Formular, sichtbare controls
Nein, bei Swissdelphicenter gibt es nur Codeschnipsel die ALLEs durchtig machen - eben das soll NICHT der Fall sein
|
Re: Transparentes Formular, sichtbare controls
Mal 'ne blöde Frage:
Welche Delphi - Version hast du? Bei Delphi 7 gibbet nämlich die Eigenschaft "TransparentColor". Die sollte dir helfen... |
Re: Transparentes Formular, sichtbare controls
Hallo :hi:
Vielleicht hilft dir auch folgender Link weiter: ![]() Wichtig ist auch, das man bei solchen sachen den BorderStyle der Form auf bsNone setzt! Mfg phlux :hi: |
Re: Transparentes Formular, sichtbare controls
hi erstmal!
hab schon viel brauchbares gefunden in diesem forum hier, und muss erst mal dank und annerkennung aussprechen :thumb: mach mal als viertletzten befehl
Delphi-Quellcode:
weiß nicht ob das das is was du suchst, bei mir war dann nur der button sichtbar :stupid:
tempregion :=
CreateRectRgn( 0, 0, Width, 0); das mit der transparent-property is glaub ich so a gschicht, wenn man das formular transparent setzt, wird der button mit transparent auch wenn dieser transparenz von 0% hat |
Re: Transparentes Formular, sichtbare controls
Liste der Anhänge anzeigen (Anzahl: 1)
Zitat:
|
Re: Transparentes Formular, sichtbare controls
stimmt sry, hatte das mit Alpha verwechselt, da werdn alle Komponenten auf dem Formular automatisch mit transparent
|
Re: Transparentes Formular, sichtbare controls
Liste der Anhänge anzeigen (Anzahl: 1)
Alles klar, so weit, so gut, danke!
Aber jetzt hab ich ein Problem mit Bildern (siehe Anhang)... Für alle die zu faul sind es sich runterzuladen :zwinker: hier ne Beschreibung: Der Rosa Rand bleibt um das Bild bestehen. Kann man das umgehen? Auf ![]() Darunter auch: Zitat:
Danke schonmal für Antworten! Lamy |
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:58 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