EditBox:HighlightText

From Warcraft Wiki
Jump to navigation Jump to search

Selects text in an EditBox.

EditBox:HighlightText([start, stop])

Arguments

start
number? = 0 - The position at which to start the highlight; defaults to 0 if not specified.
stop
number? = -1 - The position at which to stop the highlight; defaults to the end of the string if not specified. Indices use standard Lua semantics, so -1 is the end of the string.

Details

  • The position before the first character is 0.
  • Leaving out both parameters, as in EditBox:HighlightText(), will highlight the entire EditBox content.

Examples

editbox:HighlightText()       -- highlights entire content
editbox:HighlightText(0,-1)   -- also entire content
editbox:HighlightText(0,0)    -- removes highlighting