public virtual void EraseSelection()
{
int start = Math.Min(m_CursorPos, m_CursorEnd);
int end = Math.Max(m_CursorPos, m_CursorEnd);
DeleteText(start, end - start);
// Move the cursor to the start of the selection,
// since the end is probably outside of the string now.
m_CursorPos = start;
m_CursorEnd = start;
}