tagged [textbox]

C# .NET multiline TextBox with same-width characters

C# .NET multiline TextBox with same-width characters How can I make it so if you typed in a multiline `TextBox`: So that the big `E` is below the little `e`. I want them to line up vertically if they ...

29 Jun at 09:23

How to clear the text of all textBoxes in the form?

How to clear the text of all textBoxes in the form? This method above doesn't work and the controls aren't cleared. It compiles fine, but does nothing. Any ideas?

26 Jan at 23:13

How can I add a hint text to WPF textbox?

How can I add a hint text to WPF textbox? For example, Facebook has a "Search" hint text in the Search text box when the textbox is empty. How to achieve this with WPF text boxes?? ![Facebook's search...

15 Sep at 03:41

html text input onchange event

html text input onchange event is there a way to implement a text change event to detect text change on an HTML input text field? It's possible to simulate these using key events (key press etc), howe...

7 Sep at 09:20

Override Paste Into TextBox

Override Paste Into TextBox I want to override the paste function when in a specific textbox. When text is pasted into that textbox, I want it to execute the following: (Changing from multiline to sin...

How to create a numeric textbox in Silverlight?

How to create a numeric textbox in Silverlight? As the title says really. I've had a look at inheriting from TextBox, but the only sensible override was "OnKeyDown", but that just gives me a key from ...

textbox.Focus() not working in C#

textbox.Focus() not working in C# am wondering why this code fails to focus the textbox...? ``` private void sendEmail_btn_Click(object sender, EventArgs e) { String sendTo = recipientEmail_tbx.T...

4 Jan at 13:54

how to insert image in a textbox

how to insert image in a textbox Is there a way to insert an image in a textbox? I'm working on a chat application. And I want to change the values ":)", ":(" etc. with icon images. But I couldn't fin...

29 May at 14:13

Enter key pressed event handler

Enter key pressed event handler I want to capture the text from the textbox when enter key is hit. I am using WPF/visual studio 2010/.NET 4. I dont know what event handler to be used in the tag ? I al...

How to clear a textbox once a button is clicked in WPF?

How to clear a textbox once a button is clicked in WPF? How can I clear a `textbox` once a button is clicked in the WPF application, I know I have to do it in click method of the button but what code ...

23 Oct at 19:14

A textbox/richtextbox that has syntax highlighting? [C#]

A textbox/richtextbox that has syntax highlighting? [C#] Where can I find a control for WinForms that will highlight source code pasted into it? I would like one that has syntax highlighting support f...

Change the Textbox height?

Change the Textbox height? Neither of the below work: or I wanted to be able to change the single line text box height to fit a font size on it without using multi-line if possible.

2 May at 02:41

How can I sync the scrolling of two multiline textboxes?

How can I sync the scrolling of two multiline textboxes? How can I sync the scrolling of two multiline textboxes in C# (WinForms)? When you scroll up/down a line in TextBox A, TextBox B should scroll ...

29 Sep at 15:42

Which passwordchar shows a black dot (•) in a winforms textbox?

Which passwordchar shows a black dot (•) in a winforms textbox? Short question here: In , how do I use the `PasswordChar` property of a `Textbox` to show a common as a ? Is there perhaps some font I c...

11 Jul at 12:22

Convert TimeSpan from format "hh:mm:ss" to "hh:mm"

Convert TimeSpan from format "hh:mm:ss" to "hh:mm" I want to show in a TextBox only hour and minutes how to show only hours and minutes `"hh.mm"`

9 Feb at 19:20

Setting cursor at the end of any text of a textbox

Setting cursor at the end of any text of a textbox I have a text box with a displayed string already in it. To bring the cursor to the textbox I am already doing But how do I get the cursor at the end...

6 Dec at 12:27

How to disable textbox from editing?

How to disable textbox from editing? I want to use a text box to display some text. I can not disable it, because then the scroll bar will not work. How can I prevent editing within the multi-line tex...

22 Sep at 13:32

Limit number of characters allowed in form input text field

Limit number of characters allowed in form input text field How do I limit or restrict the user to only enter a maximum of five characters in the textbox? Below is the input field as part of my form: ...

10 Jun at 05:20

Make TextBox uneditable

Make TextBox uneditable I want to make some `TextBox`es on my form uneditable, but I want the `text` to be clear (black not gray) and that's why I do not want to use `myTextBox.Enabled = false;` Some...

30 Jan at 06:34

How to disable cursor in textbox?

How to disable cursor in textbox? Is there any way to disable cursor in textbox without setting property Enable to false? I was trying to use ReadOnly property but despite the fact that I can't write ...

4 Aug at 20:29

Textbox padding

Textbox padding I've searched through the internet, I must be using the wrong keywords because I can't find anything. I want to create a textbox that has text starting from a little far from the left....

9 Nov at 07:27

Create hyperlink in TextBox control

Create hyperlink in TextBox control Is there some way that I could create a hyperlink within a Textbox control? The catch: I would like only to act as a hyperlink. For example, StackOverflow.com allow...

20 Apr at 12:18

Changing Textbox text without firing TextChanged event

Changing Textbox text without firing TextChanged event My application in `C#` has a `Textbox` with a `txt_TextChanged` event. But there's one specific part that I want to change `txt.Text` without fir...

4 Jan at 06:46

Any way to make a WPF textblock selectable?

Any way to make a WPF textblock selectable? How to allow `TextBlock`'s text to be selectable? I tried to get it to work by displaying the text using a read-only TextBox styled to look like a textblock...

29 Jun at 17:0

TextBox - Can I keep the selection highlight when it loses focus?

TextBox - Can I keep the selection highlight when it loses focus? I would like to have a regular `TextBox` on my form, where the selected text is still highlighted even if you use another control, e.g...