View Full Version : Coloring text in a realBASIC MsgBox
Dec 27, 2005, 12:32 PM
Does any one know how i can colour some of the text in a realBASIC msgBox?
Dec 27, 2005, 01:10 PM
What version of RB are you using?
Dec 27, 2005, 01:23 PM
I doubt you can.
If you're really intent on coloring text, come up with your own message box that takes color as a paramater.
I might make one if I have time today.
(I have lots of free time).
Dec 27, 2005, 01:53 PM
I create my own dialogues for most tasks, then you have complete control.
Dec 27, 2005, 02:42 PM
You can always set your globals to handle things like that... here's some sample code I made for a text-base app...
'Dim Header as String
'Dim HDate as String
'Dim TimeStamp, LogEntry as String
'Dim h as new StyledText
'Dim d as new date
'Dim st as Integer
'//Setup header initiale Attributes
'Header = "Coachstat Journal"
'HDate = d.LongDate
'TimeStamp = d.shorttime + " Entry:"
'LogEntry = " This is how your journal entries will look."
'h.Text = Header + EndOfLine + Hdate + EndOfLine + TimeStamp + EndOfLine + LogEntry + EndOfLine
'//Set Header Attributes
'h.Bold(0,len(Header)) = True
'h.Size(0,len(Header)) = 18
'h.TextColor(0,len(Header)) = &cff0000
'h.Underline(0,len(Header)) = True
'st = len(Header) + 1
'//Set Date Attributes
'h.TextColor(st,len(HDate)) = &c000000
'h.Size(st,len(HDate)) = 12
'h.bold(st,len(HDate)) = false
'st = st + 1 + len(HDate)
'h.TextColor(st,len(TimeStamp)) = &cFF00FF
'h.Size(st,len(TimeStamp)) = 12
'st = st + 1 + len(LogEntry)
'h.TextColor(st, 40) = &c000000
'h.Font(0,len(h.text)) = "Comic Sans MS"
'HeaderBox.StyledText = h
Of course you may just need to set one field to have those attributes, so just use "me" and set up a styled text attribute, then equal the call for that attribute to the built in RB colors... like "=&cFFFFFF".
Dec 27, 2005, 04:44 PM
Im using version 5.5.5...
I know it can be done, and simply, cos i have seen it done by a friend in one of there programs, using a standard msg box!
He however is away for a month or two!