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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Userform background colour every 20ms.. 1

Status
Not open for further replies.

basepointdesignz

Programmer
Jul 23, 2002
566
GB
Hey all,

Is there a way to change the colour of a userform every 20ms or so - thus making a flashing, multicoloured changing form. I'm just making a joke program at work and want the userform to rapidly change colours party / celebration / fireworks-esque..

Cheers,

Paul
basepointdesignzltd..
XP Pro..
Pentium Core 2 Q6600 Quad Core
ASUS P5N-E SLI Motherboard
4GB DDR2 RAM
2 x SLI NVIDIA 8500GT SLi 1024MB DDR2 PCI-Express Graphics Cards
 
VB 5 or 6 does not have 'UserForm', we have just Form. Looks like you want to do it in VBA. Is it Excel? Word? Power Point?

Have fun.

---- Andy
 
Hi Andy,

Yeah sorry it is VBA (its actually for AutoCAD) but i thought it would be more a straight VB code answer so put the thread on this forum. I kind have found an answer anyway just need to tweak it but thanks for the reply :)

Cheers,

Paul
basepointdesignzltd..
XP Pro..
Pentium Core 2 Q6600 Quad Core
ASUS P5N-E SLI Motherboard
4GB DDR2 RAM
2 x SLI NVIDIA 8500GT SLi 1024MB DDR2 PCI-Express Graphics Cards
 
I would put a Timer on the Form, set its Interval property to 20 (that's pretty quick), set a Random number generator and assign .BackColor property of the Form to this random number.

If you have some code and need some advice, post it here.

Have fun.

---- Andy
 
Yep, that's how it might be done in VB, Andy - but UserForms do not have a timer control ...
 
Good point, I know.
But Paul cal always just do this to find how to create Timer in VBA

Have fun.

---- Andy
 
Ooh - that reads a little harshly. What I meant was that the first few pages returned by that search provide very poor solutions to the stated problem.
 
That’s OK, strongm
We all know that any post on the Internet is right, correct, well-reasoned, the best solution to any problem, etc. (yeah, right… :) )


Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top