Blinking font

J

Jess

I have a textbox in form. That box -the font- must flink sometimes -depending
on the form content- in order to get the user's attention.

How can I accomplish this?
 
D

Douglas J. Steele

Are you certain you want to do this? Not only do many users find it
extremely annoying, there have been cases of people with epilepsy having
convulsions caused by flashing text.

If you're sure you want to do it, set the form's TimerEvent to an
appropriate value (it's the number of milliseconds between event firings, so
if you want to flash once a second, you'd set it to 1000), then put code in
the form's Timer event to change the colour of the text (or whatever you
want to do to get the effect). To turn the flashing off, set the TimerEvent
back to 0.
 
J

Jeff Boyce

Jess

I'm with Doug ... folks find blinking text annoying and potentially
dangerous.

If you redefine your requirement to "the user needs to notice the textbox",
there are other ways to accomplish that.

For instance, if you used an event to change the background color of that
control to, say, red, that would stand out, right?

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

John Spencer

You have to use the FORM's timer event and timer interval

I would set the TimerInterval to zero based on when the blinking should not
occur and then set the TimerInterval to 1000 (1 second) when the conditions
exist that require the control to blink and set the TimerInterval to 0 when
the conditions do not exist.

Then the Timer Event would have code like this to change to alternate the text
color between white to black.
Private Sub Form_Timer()
If Me.fText.ForeColor = vbWhite Then
Me.fText.ForeColor = vbBlack
End If
End Sub

Or you could use
Me.ftext.Fontbold = NOT(me.fText.Fontbold)
to switch from normal to bold

If that is too subtle
Me.fText.FontWeight = 400 + (-500 * Me.ftext.FontWeight <> 400)



John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top