Tim,
>I was looking for an idea how to create a class or method to parse a label's chars and have each one a different color, if at all possible.
Let me propose a much simpler solution using some little used form methods:
dodefault()
if ( empty( this.Tag ) )
this.CurrentX = this.Label1.Left
this.CurrentY = this.Label1.Top
for i = 1 to len( this.Label1.Caption )
this.ForeColor = rgb( rand() * 255, rand() * 255, rand() * 255 )
this.Print( substr( this.Label1.Caption, i, 1 ) )
endfor
endif
this.Tag = "first activation done"
put this code in the Activate() instead of Init() because the form has to be visible and the initial painting of the label would going to overwrite the this.Paint() output. You can control it with a real boolean property I've just hacked it with tag for demo.
You can create a label class that lets you embed color change commands inside the Tag or custom property and use them to set the forecolor property instead. Something like:
"This <0xFF0000>is red
now it's black"
Or come up with some other scheme where you can set the Caption to the real text value you want displayed and this will let you position the label and controls correctly at design time and read the color changes from a separate property.
This is a lot lighterweight than adding additional label letters and it allows you to keep stuff like Click() methods of the label intact.