Page History
...
Applies to
Edit Box Control
Syntax
Code Block |
---|
Status = Send_Message(CtrlEntID, "SETCHARFORMAT", ApplyFormatTo, CharFormat) |
...
Parameters
Parameters are as follows:
...
If successful returns a 1, otherwise returns a null.
Example
Code Block |
---|
Declare function Send_Message
Red = 255
Green = 255 * 256
Blue = 255 * 65536
//ApplyFormatTo = 0 // Default
ApplyFormatTo = 1 // Selection
//ApplyFormatTo = 2 // Word
//ApplyFormatTO = 4 // All
// All of these items are only set only if there
// is a value in the field (or value). If the field
// (or value) is empty, then that characteristic
// does not change.
// CharFormat<1> // Effects Flags
// CharFormat<1,1> = Boolean // Bold
// CharFormat<1,2> = Boolean // Italic
// CharFormat<1,3> = Boolean // Underline
// CharFormat<1,4> = Boolean // Strike Out
// CharFormat<1,5> = Boolean // Protected
// CharFormat<1,6> = Boolean // Link
// CharFormat<1,7> = Boolean // Auto Color
// CharFormat<2> = Integer // Size
// CharFormat<3> = Integer // Offset
// CharFormat<4> = Integer // Color
// CharFormat<5> = Integer // Character Set
// CharFormat<6> = Integer // Pitch And Family
// CharFormat<7> = String // Face Name
// CharFormat<8> = Integer // Weight
// CharFormat<9> = Integer // Spacing
// CharFormat<10> = Integer // Back Color
// CharFormat<11> = Integer // Lcid
// CharFormat<12> = Integer // Style
// CharFormat<13> = Integer // Kerning
// CharFormat<14> = Integer // Underline Type
// CharFormat<15> = Integer // Animation
// CharFormat<16> = Integer // Revision Author
// Create some test text
x = Set_Property(@window:'.EDIT_AREA', 'TEXT', "This is a test...")
// Select "is a"
x = Set_Property(@window:'.EDIT_AREA', 'SELECTION', 6:@fm:4)
// Make the "is a" bold and blue
CharFormat = ''
CharFormat<1,1> = '1'
CharFormat<4> = Blue
x = Send_Message(@window:'.EDIT_AREA', 'SETCHARFORMAT', ApplyFormatTo, CharFormat)
// Reset the cursor back to the beginning
x = Set_Property(@window:'.EDIT_AREA', 'SELECTION', 1:@fm:0)
|