Monday, November 16, 2009

Coloring your Message Log

Sub CorrectRGBComponent(ByRef component)
component = aqConvert.VarToInt(component)
If (component <>
component = 0
Else
If (component > 255) Then
component = 255
End If
End If
End Sub

Function RGB(r, g, b)
Call CorrectRGBComponent(r)
Call CorrectRGBComponent(g)
Call CorrectRGBComponent(b)
RGB = r + (g * 256) + (b * 65536)
End Function

Sub Test
Set Attr = Log.CreateNewAttributes
Attr.FontColor = RGB(192, 0, 0)
Attr.BackColor = RGB(255, 255, 0)
' Passes the LogAttributes object to the Message function
Log.Message "My message", "", pmNormal, Attr
End Sub

No comments:

Post a Comment

I welcome your comment, will respond and post it at the earliest:)