Insert text into WPF textbox at caret position -


How can I insert text in a WPF text box in the carat state? What am I missing? In Win32, you can use CEdit :: ReplaceSel ().

This should work as the paste command () was implemented. But I want to avoid using the clipboard.

To enter text in the bus status:

  textbox. Text = textbox.Text.Instert (text box; carat indices, "& lt; new text";);  

To replace the selected text with the new text:

  textbox.SelectedText = "& lt; New text & gt;";  

To scroll the text box on the caret position:

  int lineIndex = textbox.GetLineIndexFromCharacterIndex (textBox.CaretIndex); TextBox.ScrollToLine (lineIndex);  

Comments

Popular posts from this blog

asp.net - Change the driver in the connection string to a data source in VB.Net -

objective c - iPhone and it's wireless area -

unix - Listing all shared memory segments used by a process on AIX5.3+ -