Re: making a form transparent



Another suggestion, instead of making the timer count 1 millisecond,
set it to one second, for testing. If it is flashing on and off for
one millisecond, then can your eye tell if it is off or on..
I've also added a bit to the section below..

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

In this routine, this will not increment, cause it isn't in
a loop. This routine only gets called when the timer has expired.
The counting of the timer towards the deadline happens automatically
you don't have to manually check if it has reached 50.
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: what is the fast(est) way to calculate millisec time span in mfc
    ... The millisecond timer is updated only every 15ms. ... resolution at the ms level. ... be aware that hundreds of milliseconds can elapse between the packet being ...
    (microsoft.public.vc.mfc)
  • RE: WaitForSingleObject timeout not working
    ... Do you mean that the high-resolution timer will also get the same problem ... This is a problem with the *assumption* about GetTickCount(). ... counter is not updated frequently enough to provide accurate millisecond ... resolution. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: do pop up boxes stop all events?
    ... one millisecond, it will get a millisecond behind ... millisecond Interval period) and you are talking about the timer possibly "falling behind" by a millisecond because you have "stressed it" and perhaps delayed a single timer event from firing, and it will never catch up. ... But all of that is totally irrelevant, because I'm telling you that the cause of the VB Timer Control failing to provide 100 Hz is nothing whatsoever to do with it "being stressed" or it "missing a single timer event" because of something your code has done! ...
    (microsoft.public.vb.general.discussion)
  • Re: GetTickCount Problem in Intel BSP for pxa255
    ... there is a hardware timer that interrupts the ... processor every millisecond. ... By stubbing out OEMIdle(), the scenario above runs continuously, ...
    (microsoft.public.windowsce.platbuilder)
  • Re: TimeSetEvent - Decimal Interval?
    ... I am writing a DrumMachine Program and as you can figure out, the timer ... Public Declare Function timeSetEvent Lib "winmm.dll" (ByVal uDelay As ... There is no such thing as a 'double precision integer' ... I doubt that Windows understands the concept of a partial millisecond ...
    (microsoft.public.vb.general.discussion)