Autor Beitrag
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: Sa 10.12.05 08:45 
Hallo Leute,
ICh möchte auch ein Formular transparent anzeigen,
Nur wurden mir in anderen Beiträgen nur
Alphablend und Transparencolor genannt, doch bei meinem Delphi 5
gibts das bei Form1 nicht.
Gibt es noch alternativen??
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 10.12.05 09:19 
Gruss !
Ist nicht von Mir (getestet mit Delphi4)

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
function SetLayeredWindowAttributes(const hWnd: HWND; crKey: DWord; 
  bAlpha: Byte; dwFlags: Longint): Integer; stdcall; external 'User32.dll'; 
 
implementation 
 
{$R *.DFM} 
 
const 
  LAYERED = 524288; 
 
procedure Transparenz(h: THandle; Alpha: Byte); 
begin 
  SetWindowLong(h, GWL_EXSTYLE, GetWindowLong(h, GWL_EXSTYLE) or LAYERED); 
  SetLayeredWindowAttributes(h, 0, Alpha, 2); 
end; 
 
procedure Normal(h: THandle); 
begin 
  SetWindowLong(h, GWL_EXSTYLE, GetWindowLong(h, GWL_EXSTYLE) 
    and not LAYERED); 
end; 
 
// Tranzparenz einstellen 
procedure TForm1.Button1Click(Sender: TObject); 
begin 
  Transparenz(handle, 175); // 255 = nicht transparent; 0 = total durchsichtig 
end; 
 
// Tranzparenz abschaltehn 
procedure TForm1.Button2Click(Sender: TObject); 
begin 
  Normal(handle); 
end; 
 
end.
Fighter#1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: Sa 10.12.05 09:44 
Titel: THx
Riesen Dankeschön.
Funktioniert einwandfrei,
Danke für die schnelle Hilfe




MfG Fighter#1