textBox add text without deleting previous contents
-
yeah, how do I add text to a textBox (programmatically, not via the user) on the next line if there is already text in it? danke schon, Stephen
textBox.Text += "\r\n" + newTextToAdd;
-
yeah, how do I add text to a textBox (programmatically, not via the user) on the next line if there is already text in it? danke schon, Stephen
Also if you want to insert text at the current active point in the edit control you can programatically copy text to the clipboard then paste it in to the control by calling the controls' paste method. (it's the only way to insert text into the current position or replace highlighted text as far as i know) If you just want to append it then it's a simple: control.text+="some new text";
-
Also if you want to insert text at the current active point in the edit control you can programatically copy text to the clipboard then paste it in to the control by calling the controls' paste method. (it's the only way to insert text into the current position or replace highlighted text as far as i know) If you just want to append it then it's a simple: control.text+="some new text";
Sorry to correct you, but
TextBox
has aSelectedText
property, that, when set, just does what you describe: replace the text currently selected. If there's no text selected, settingSelectedText
will insert this text at the cursor position. :-> mav -
Sorry to correct you, but
TextBox
has aSelectedText
property, that, when set, just does what you describe: replace the text currently selected. If there's no text selected, settingSelectedText
will insert this text at the cursor position. :-> mav