Links |
---|
Sets the position of the cursor in the edit box.
editBox:SetCursorPosition(position)
Arguments
- position
- Number - New editing cursor position; the cursor is set after
position
'th character of the string.
Notes
- This method can be used to scroll edit boxes displaying long strings. For instance:
local editBox = CreateFrame("EditBox", "WPDemoBox", UIParent, "InputBoxTemplate")
editBox:SetSize(100, 20)
editBox:SetPoint("CENTER")
editBox:SetAutoFocus(false)
editBox:SetText("Can't beat my, can't beat my, // No you can't beat my leather shoes. // I have got some leather shoes...")
editBox:SetCursorPosition(0)
- Without the last line, the edit box would display the end, rather than the beginning its text.