Garry's Mod Wiki

Panel:GetCaretPos

  number Panel:GetCaretPos()

Description

Returns the position/offset of the caret (or text cursor) in a text-based panel object.

Returns

1 number
The caret position/offset from the start of the text. A value of 0 means the caret sits before the first character.