Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coding Special Effect on Label 2

Status
Not open for further replies.

TTThio

Programmer
May 3, 2001
185
US
Hi,

is it possible to give a special effect to a label to draw user's attention, such as blinking whenever the form is opened?

So far, I just find topics on data access page. How about for .mdb?

Thanks ahead,
Tin Tin
 
You can do blinking by using a timer and setting the caption of a label alternating between "" and "Label:" Is there a certain special effect you're interested in?

Joe Miller
joe.miller@flotech.net
 
Joe,

I'm not familiar with it. How to set it?
I tried
lbl.caption = ""
lbl.caption = "X"

but after changing to X, it's not changing back (not blinking).

So far, I just need to make it blink.
Is there any sources for this info?

Thanks Joe.
 
how about scrolling text

In the forms ontimer event paste this code

Private Sub Form_Timer()
Dim textlen As Integer, textstr As String
Dim strfield As Variant
Static astr As Integer
strfield = "hello world" & "" 'replace text with what ever you want
textlen = Len(strfield)
astr = astr + 1
If astr >= textlen Then astr = 1
textstr = Mid([strfield], astr, Len([strfield])) & " " & Left([strfield], astr)
Me.yourlabel.caption = textstr 'replace name here
End Sub
and then

set the forms timer interval property to around 500
 
Set your timer to something like 250 (timer is a FORM property). Then put in this statement in the OnTimer event:

[tt]
If lbl.Caption = "X" Then
lbl.Caption = ""
Else
lbl.Caption = "X"
End If
[/tt]

Another way to do it is with code like this (I prefer this one):

[tt]
lbl.Visible = Not lbl.Visible
[/tt]

HTH Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top