I have a TextBox named textbox1 and a Button named button1. When I click on button1 I want to browse my files to search only for image files (type...
Does anybody know how to move the keyboard caret in a textbox to a particular position? For example, if a text-box (e.g. input element, not text-area) has 50 characters...
If I call SelectAll from a GotFocus event handler, it doesn’t work with the mouse – the selection disappears as soon as mouse is released. EDIT: People are liking...
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...
How can I put some text into a TextBox which will be removed automatically when the user types something in it? 34 Answers 34 You can create a watermark...
I have a textbox with the .Multiline property set to true. At regular intervals, I am adding new lines of text to it. I would like the textbox to...
I’m looking to accept digits and the decimal point, but no sign. I’ve looked at samples using the NumericUpDown control for Windows Forms, and this sample of a NumericUpDown...
I have a web form with a text box in it. How do I go about setting focus to the text box by default? Something like this: <body onload='setFocusToTextBox()'>...
I am developing an app for sending some feedback. Basically I’m trying to make a TextBox for comments, but I’m used to the WinForms MultiLine=true. I’ve set MinLines to...
I want to detect whenever a textbox’s content has changed. I can use the keyup method, but that will also detect keystrokes which do not generate letters, like the...