Friday, February 24, 2017

TitleBarX Color Cycling Trick

What is TitleBarX again?

It is a class to replace the form's titlebar.  It has these features:

1.  Two captions
2.  Ability to change on-the-ply its color and the objects on a form, and retain those via a popup colorwheel

To take a thorough glimpse on what this class is, click here

A subscriber emailed me just now and asked if we can change its default behavior of picking up the last color scheme.  What he wanted instead is to dictate to the class the color cycling which is based on the day of the week.  So for Monday, a color, Tuesday another color and so on...

Well, the trick is simple enough so I will show it here in case some of those who use it wants to do the same.  The trick is to put something like this on its Init Event:

* TitlebarX Init
DODEFAULT()
Do Case
      Case Dow(Date()) = 1
            This.BackColor = Rgb(0,128,128)
      Case Dow(Date()) = 2
            This.BackColor = Rgb(128,255,0)
      Otherwise
            This.BackColor = Rgb(138,176,66)
Endcase
This._swapcolor()

And that is it!  Cheers!





1 comment:

  1. this is my favorite class. Easy to use and gives our system a new life and looks.
    Great Class!

    ReplyDelete