Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Simpe simple Ms-Word Visual Basic Animation

Posted on 2000-03-27
8
Medium Priority
?
261 Views
Last Modified: 2013-11-25
This is hardly even animation.

Say I have a form, "frmFormTitlePage".
Say I have a label on that form, "lblTitle"

I would like to have the text on lblTitle.caption to change colors every other second.  I've tried doing this numerous times by using a TIMER but I can't seem to get it right.  I know the color codes (RGB etc..) so it's not a problem in that area.  Ideas?

-rick, detroit
0
Comment
Question by:saksafon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 3

Expert Comment

by:Lewy
ID: 2661387
Do you have a DoEvents after changing the color?
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2661389
You are most likely not refreshing the control after you change the color... try this...

Add a label called "Label1" to a new project.

Add a Timer called "Timer1" to the project.

Set Timer1's Interval property to 2000 and Enabled property to TRUE.

Put the following code in the Timer1 event:

Private Sub Timer1_Timer()
    Dim iVal As Integer
    iVal = Val(Label1.Tag)
    iVal = iVal - 1
    If iVal = -1 Then iVal = 15
    Label1.ForeColor = QBColor(iVal)
    Label1.Refresh
    Label1.Tag = CStr(iVal)
End Sub

Run the program... This is just an example of changing the label's color... It runs through all 16 QBColors...


Cheers!®©

0
 
LVL 14

Expert Comment

by:mcrider
ID: 2661401
Lewy, You don't need to use doevents... It's a dangerous call that can get you into alot of trouble if you don't use it properly...


Cheers!®©
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

Author Comment

by:saksafon
ID: 2661426
"Add a Timer called "Timer1" to the project.
Set Timer1's Interval property to 2000 and Enabled property to TRUE. "

Is this a VB thing?  I'm using Word VB and I don't know if I have access to this.  Where would I find a timer and how would I place it and change settings?  I'll keep looking but I don't know if I have the ability to add one.. hmm!

rick


0
 
LVL 3

Expert Comment

by:SirNick
ID: 2661515
In the past the way I have done this is

Private sub timer1_timer()
   lbltitle.forecolor = qbcolor(rnd*15)
end sub

I hope this helps..
0
 
LVL 32

Accepted Solution

by:
Brendt Hess earned 200 total points
ID: 2662017
To get a timer on your form:

Right Click on your toolbar, and choose "Additional Controls".  Scroll down until you find the Timer Object reference, then click the check box next to it.  Click OK.

Your toolbar now has a clock-like object on it.  Select it, and draw it on your form.

In the Properties of the timer control, change the Interval property to the number of milliseconds between times you want it to run (1000 ms = 1 second).

Set Visible to false, and Enabled to true.

Double click the timer control, and you should get the _Timer event code block (probably IETimer1_Timer().  Put your color changing code in there.

Now, when you have the form up, every second, the IETimer1_Timer code will be executed, changing the color of the text.
0
 

Author Comment

by:saksafon
ID: 2663857
Adjusted points from 30 to 50
0
 

Author Comment

by:saksafon
ID: 2663859
Wow.. I didn't even know "additional controls" existed.  'ah I'm just a hack.

Thanks

rick
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 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