Re: making a form transparent



I've also done a similar thing, but I also use visible.
Code below..
..... start code....
procedure TMainForm.Timer2Timer(Sender: TObject);
begin
  // this routine is in the Ontimer event of Timer2
  // it only gets called when the timer has counted
  // the required time.
  Label1.Visible := False; // Turn off the label, make it invisible.
  Timer2.Enabled := False;   // turn off Timer2, ready for the next call
end;

Calling procedure....
 if (condition is true) then
   begin
     Label1.Visible := True; // turn on the label and make it visible.
     Timer2.Interval := 4000;  // set the duration of the Timer2
     Timer2.Enabled := True;   // Turn on Timer2
   end
end calling procedure.
..... End code....

In english, what I've done.
1. The calling routine checks if I want the hidden label
   turned on.
2. if yes, then make the label visible, and start the timer.
3. the timer reaches the required time, and makes the label
   invisible, and also turns off the timer.

anthony wrote:
Heinrich Wolf wrote:

Hi,

set the form's BorderStyle to bsNone
and in it's create event set it's Brush.Style to bsClear.
Put a label on the form and set it's transparent property to true.

Regards
Heiner


Yes that works great, I can flash a message on the screen anywhere I like, but I am having trouble clearing it again, I have two timers running, one to put the message on the screen after a certain time, which also starts timer2 going to count down how long to leave it on screen. but when I have to erase the message it stays there, I cant even set the label1 caption to '';

here is the timers code

procedure TForm1.Timer1Timer(Sender: TObject);
begin
/ timer1 is set to 5 secs

max:=50;  /max time to display in milliseconds
count:=0; /just a counter to count the milliseconds

timer2.Enabled:=true;       /turn on timer2
timer1.Enabled:=false;      /turn off timer1
label1.Caption:='hi there'; /set the message to be displayed


end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin

/ timer2 is set to 1 millisecond

count:=count+1;  /increment the counter
if count>=max then  /has it reached 50?

begin
label1.Caption:=' ';  /clear the message

timer2.Enabled:=false; /turn timer2 off
timer1.Enabled:=true;  /turn timer1 back on for the next five secounds
end;



What I am trying to do is make an application that will put subliminal messages on the screen


Help please


Anthony
.



Relevant Pages

  • RE: Make a label "flash" on a form
    ... I can't help you understand WHY it's not working, but with the Form's Timer ... the following code in the OnTimer event ... name of your label. ... I'm using a SetValue action to set the ...
    (microsoft.public.access.forms)
  • how to detect printer change?
    ... i put a timer and a label on a form, ... the OnTimer event: ... I launch the program, the label is the default printer ...
    (alt.comp.lang.borland-delphi)
  • Re: how to detect printer change?
    ... i put a timer and a label on a form, the OnTimer event: ... I launch the program, the label is the default printer then i change the default printer with Start/Parameters/Printers... ...
    (alt.comp.lang.borland-delphi)
  • Re: Timer Label Visibility Question
    ... Private Sub cmdLogIn_Click ... turn a wheel in the status bar or in the label. ... Private miCountDown As Long ... There's a Timer on the form which adjusts a count. ...
    (microsoft.public.vb.general.discussion)
  • Re: Timer not working in thread
    ... My application processes a file and updates the data into sql server. ... display the user a labelwith ... The timer won't works when the thread is started, so the label is not ...
    (microsoft.public.dotnet.languages.csharp)