Solved

How to do TStaticText transparent?

Posted on 1999-01-25
5
731 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
5 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 150 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I think there is a transparetn property for the TStaticText,..
0
 

Author Comment

by:inkom
Comment Utility
Adjusted points to 150
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now