AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

TStaticText.Transparent funktioniert nicht?

Ein Thema von stz · begonnen am 14. Jul 2006 · letzter Beitrag vom 12. Feb 2016
Antwort Antwort
Benutzerbild von Flocke
Flocke

Registriert seit: 9. Jun 2005
Ort: Unna
1.172 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#1

Re: TStaticText.Transparent funktioniert nicht?

  Alt 14. Jul 2006, 19:58
Nur zur Info: es hat eigentlich nichts damit zu tun, dass das Fenster ein Handle hat (also ein richtiges API-Fenster ist) - andere "richtige" Fenster können auch transparent sein.

Die Implementierung in der VCL sieht nicht sonderlich gut aus. Es funktioniert offenbar nur, wenn ein Manifest eingebunden wird, also Theming für die Anwendung aktiviert wird.
Volker
Besucht meine Garage
Aktuell: RtfLabel 1.3d, PrintToFile 1.4
  Mit Zitat antworten Zitat
papajong

Registriert seit: 16. Jun 2006
3 Beiträge
 
RAD-Studio 2010 Pro
 
#2

AW: TStaticText.Transparent funktioniert nicht?

  Alt 12. Feb 2016, 14:57
Nur für den Fall, das sich nochmal jemand hierhin verirrt, transparent funktioniert nur,
wenn man das darunterliegende Control zum Parent des TStaticText macht.
PS. Funktioniert auch bei TLabel

unit Unit1;

interface

uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls, Vcl.ComCtrls;

type

TForm1 = class(TForm)
Timer1: TTimer;
ProgressBar1: TProgressBar;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
FStaticText1: TStaticText;
public
{ Public-Deklarationen }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin

FStaticText1 := TStaticText.Create(Self);

with FStaticText1 do
begin
Name := 'StaticText1';
Parent := ProgressBar1;
Left := ProgressBar1.Width div 2;
Top := 1;
Width := 59;
Height := 17;
ParentCustomHint := False;
BiDiMode := bdLeftToRight;
Caption := '';
Color := clBtnFace;
ParentBiDiMode := False;
ParentColor := False;
TabOrder := 1;
Transparent := true;
end;

end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
ProgressBar1.StepIt;
FStaticText1.Caption := IntToStr(ProgressBar1.Position);
end;

end.

Geändert von papajong (12. Feb 2016 um 15:15 Uhr) Grund: Ergänzung
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:09 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