Link to home
Start Free TrialLog in
Avatar of aggressorperfector

asked on

how do i make a transparent (delphi 6) statictext label

how can i make a transparent (delphi 6) statictext label...,

 i need a transparent label of some sort upon which a filename is presented, for a install (setup) program, the problem is that,
my code contains a for-to-do loop in which i try to update the caption of a label (i have tried both Tlabel and statictext labels), the TLabel component will freeze until the loop is finished, and you only see the last filename that was executed in the loop, the statictext however, displays every filename and has no problems having it's caption changed so quickly, but the problem is you cannot make it truely transparent...

can i doublebuffer a TLabel?...
 i have tried
  statictext1.color := clTransparentColorValue;

  Deriving the component and exposing the canvas but still cannot use the canvas properly

can use please help me?... (i have paid my $9.99US after all, sorry don't take that insultingly)...

p.s. i do have a few other questions (2-3) to ask but i shall ask them one at a time...
Avatar of Imthiyaz_ph

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kretzschmar
agreed with Imthiyaz_ph
don't agree :)
maybe better will be

  Label1.Caption := 'New caption'

?? >don't agree :)

not sure, but would not the refresh also send a paintmessage, which must processed?

no, it repaints immediately
>no, it repaints immediately

well, no delphi on hand yet, so i cannot validate
will do this later
Avatar of Imthiyaz_ph

mokule is right, Refresh calls the Repaint method of TLabel and its immediate.
i am just thinking about, if a background image is applied,
in this case also the parent have to paint its background new
(erasebkgnd-message/paint-message) before the label itself can paint

its just a thought, but if you both say it works immediately,
then both solutions are right, whereas the refresh method
is less ressource intensiv

i would prefer the application.processmessages-method,
not only for the repaintijng of the label, also to keep the form
accessable (move/resize,etc)

meikl ;-)