Solved

How to do TStaticText transparent?

Posted on 1999-01-25
5
742 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
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

770 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