guides:programming:programmers_reference_manual:getcharformat_message

GETCHARFORMAT message

Retrieve format information for the currently selected text within a Rich Edit control.

Edit box.

charformat = Send_Message(controlID, "GETCHARFORMAT", appliesTo)

Parameters are as follows.

appliesTo values:

ValueDescription
0Default formatting information for the control
1Current selection/cursor position

Same format as SetCharFormat message. A Null field indicates that the particular format does not apply to the requested selection.

Declare function Send_Message

 

Red = 255

Green = 255 * 256

Blue  = 255 * 65536

 

ApplyFormatTo = 1     // Selection

// 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', 'GETCHARFORMAT', ApplyFormatTo, CharFormat)

 

// Reset the cursor back to the beginning

x = Set_Property(@window:'.EDIT_AREA', 'SELECTION', 1:@fm:0)

 

// Get the format

 

x = Set_Property(@window:'.EDIT_AREA', 'SELECTION', 6:@fm:4)

charFormat = Send_Message(@window:'.EDIT_AREA', 'SETCHARFORMAT',ApplyFormatTo)
  • guides/programming/programmers_reference_manual/getcharformat_message.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1