Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Caption in TGraphicControl (https://www.delphipraxis.net/123501-caption-tgraphiccontrol.html)

Heiland 3. Nov 2008 13:07


Caption in TGraphicControl
 
Hi Leutz,
hab `mal ne Frage....und zwar wollt ich mir ne eigene Panelkomponente erstellen, die so von der Hintergrundfarbe bissl Gradientstylemäßig ist :mrgreen:

das hab ich soweit hinbekommen...nur krieg ich das mit der Captioneigenschaft nicht so richtig hin...was muss ich denn tun, dass die Caption mir auf der Komponente angezeigt wird?
Wenn ich nur die Property Caption reinnehme gehts zumindestens nich :gruebel:
Ich dank euch schonmal!

LG Erik

Bernhard Geyer 3. Nov 2008 13:15

Re: Caption in TGraphicControl
 
Zitat:

Zitat von Heiland
Wenn ich nur die Property Caption reinnehme gehts zumindestens nich :gruebel:

Soll der Compiler erraten was du machen willst :gruebel: Du mußt den Text schon mit DrawText oder TextOut Win32-API-Technisch ausgeben.

Heiland 3. Nov 2008 13:20

Re: Caption in TGraphicControl
 
blos wenn ich es mit Textout angebe, dann hab ich um den Text ein weißes Rechteck...

Heiland 3. Nov 2008 13:26

Re: Caption in TGraphicControl
 
Also ich habs jetz nochmal mit DrawText probiert, aber da hab ich das gleiche Problem :cry:

DeddyH 3. Nov 2008 13:34

Re: Caption in TGraphicControl
 
Geht es so?
Delphi-Quellcode:
SetBkMode(Canvas.Handle,TRANSPARENT);
R := Rect(0,0,Width,Height);
DrawText(Canvas.Handle,'Hallo',-1,R,DT_CENTER or DT_VCENTER or DT_SINGLELINE);

holliesoft 3. Nov 2008 13:35

Re: Caption in TGraphicControl
 
Hi,

hast Du vor dem TextOut den Canvas.Brush.Style auf bsClear gesetzt?

Gruß
Patrick

Heiland 3. Nov 2008 13:41

Re: Caption in TGraphicControl
 
:oops: Oh Gott :wall:
Ja es lag nur am Brush.Style.....jetz funzts....Danke !!!


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:16 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz