Solved

How to do TStaticText transparent?

Posted on 1999-01-25
5
754 Views
Last Modified: 2012-06-27
Hello All!

Help me please. I have problem. I needed to create moving on the timer, textual component. I can not use TLabel, because it blinks during drawing. TStaticText does not blink, but it not transparent. Adjust StaticText.ComponentStyle in not csOpaque does not help.
Prompt me pls, how do I decide this problem?

Thank, Nick G.
0
Comment
Question by:inkom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 150 total points
ID: 1363207
Double buffer it! Create 2 TLabels on the the same positon. When an update has to be done update the invisible one with new text, then make it visible and make the old one invisible. So at every update you switch between the 2 TLabels.

Give it your best shot and let me know if it works!
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1363208
Or try this (cleaner than having two of them...

SetWindowLong(StaticText1.Handle, GWL_EXSTYLE,
                        GetWindowLong(StaticText1.Handle, GWL_EXSTYLE)                                                OR WS_EX_TRANSPARENT);

Cheers,

Raymond.

0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1363209
Maybe you should use this too:

SendMessage(form1.handle, WM_SETREDRAW, 0, 0); to lock redraw
SendMessage(form1.handle, WM_SETREDRAW, 1, 0); to unlock redraw

Or try to write directly with form1.canvas.textout and change form1.canvas.textflags to your needs.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1363210
I think there is a transparetn property for the TStaticText,..
0
 

Author Comment

by:inkom
ID: 1363211
Adjusted points to 150
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question