private void Button_Click(object sender, RoutedEventArgs e) { DevExpress.XtraRichEdit.API.Native.DocumentPosition pos = txtHtmlControl.Document.CaretPosition; SubDocument doc = pos.BeginUpdateDocument(); var selectedText = property; string propName = string.Concat("{", externType, ".", selectedText, "}"); if (string.IsNullOrEmpty(txtHtmlControl.Text)) { txtHtmlControl.Text = propName + " "; } else { doc.InsertText(pos, propName + " "); pos.EndUpdateDocument(doc); var position = txtHtmlControl.Document.CreatePosition(pos.ToInt() + propName.Length); txtHtmlControl.Document.CaretPosition = pos; } txtHtmlControl.Focus(); }
public Rectangle GetBoundsFromPosition(DevExpress.XtraRichEdit.API.Native.DocumentPosition pos);