Skip to main content

Rich Edit

Overview

Rich Edit is to receive users' input and supports multi-line editing and a part of HTML syntax.

Users should click the Rich Edit to get focus (a typing cursor will flash in the editing bar) before typing. Click areas outside the Rich Edit will make it fail to obtain users' input because of losing focus.

  • Get Focus

  • Lose Focus

The HTML code of the pictures above are as follows:

<font style="color:#8431bb">123</font>
<br/>
<font style="color:#567890">456</font>

Properties

PropertyDescription
TextContent shown in the current RichEdit.
Font ColorShow the font color of the control.
Hint TextShow hint text when the mouse is over the control.
Support HTMLWhether the control supports HTML parsing.

Events

Callback NameCallback Function
on_get_focusThe callback to get focus by clicking.
on_lost_focusThe callback to lose focus by clicking.
on_changedThe callback when the input content changes.
on_enterThe callback when pressing the Enter key.

Lua Script Example

self.Text = "Edit"
self.AlwaysVScroll = true

function on_rich_edit_enter(self)
local str=nx_string(self.Text)
nx_msgbox(str)
end