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!

Form Background

Status
Not open for further replies.

Goodloe

Programmer
Sep 4, 2001
25
US
Hi, I'm working on a special project in VB6 that would involve changing of the background color of a Form. If it's even possible to do this, the project I'm working on would require the form background to give the appearance of changing from morning to night. In other words, it would have the color of morning, and gradually the morning color would change to an afternoon color, then an evening color, and finally a night color.

Is it possible to do such a thing? If so, I could sure use your help, including providing the proper code. Thanks...
 
What about drawing a box over your entire form and changing the fill colour of that?

VF
 
If you put a timer on a form and set it's interval to 1 and then add this code to the timer event and watch what happens. You would have to play with this,,, making the timer interval longer, changing the different RGB values, etc.

Static Count1 As Long
Static Count2 As Long
Static Count3 As Long

Count1 = Count1 + 1
Count2 = Count1 + 2
Count3 = Count2 + 3
If Count1 > 255 Then Count1 = 0
If Count2 > 255 Then Count2 = 0
If Count3 > 255 Then Count3 = 0

Form1.BackColor = RGB(Count1, Count2, Count3)

this is just something i threw together quick so it resembles nothing like day to night... you'll have to play around with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top