Questions tagged [textbox]

A textbox is a graphical user interface element which allows for simple input text, usually only a single line of text.

A text box, text field or text entry box is a kind of widget used when building a graphical user interface (GUI). A text box's purpose is to allow the user to input text information to be used by the program. User-interface guidelines recommend a single-line text box when only one line of input is required, and a multi-line text box only if more than one line of input may be required. Non-editable text boxes can serve the purpose of simply displaying text.

A typical text box is a rectangle of any size, possibly with a border that separates the text box from the rest of the interface. Text boxes may contain zero, one, or two scrollbars. Text boxes usually display a text cursor (commonly a blinking vertical line), indicating the current region of text being edited. It is common for the mouse cursor to change its shape when it hovers over a text box.

Wikipedia article: https://en.wikipedia.org/wiki/Text_box

Alternatively text box referred to as a text field, a text box is a section of a page that enables a user to enter text. Text boxes are often used on the Internet for pages that require input from a user. Below are some examples of text boxes you are likely to encounter.

One-line text box

A one-line text box is often used when only a few words, such as a name, are required.

single line

Scrolling text box

A scrolling text box allows a user to enter lots of data and usually scroll up, down, left, or right to view the text in the box.

multi line

In HTML, a textbox can be made with either <input type=text></input> or <textarea></textarea>.

12672 questions
96
votes
4 answers

Making a WPF TextBox binding fire on each new character?

How can I make a data binding update as soon as a new character is typed in a TextBox? I'm learning about bindings in WPF and now I've become stuck on a (hopefully) simple matter. I have a simple FileLister class where you can set a Path property,…
luddet
  • 1,235
  • 1
  • 11
  • 11
93
votes
10 answers

TextBox.TextChanged event firing twice on Windows Phone 7 emulator

I have a very simple test app just to play around with Windows Phone 7. I've just added a TextBox and a TextBlock to the standard UI template. The only custom code is the following: public partial class MainPage : PhoneApplicationPage { public…
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
90
votes
6 answers

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

Short question here: In .Net 4.0 Winforms, how do I use the PasswordChar property of a Textbox to show a common black dot as a character? Is there perhaps some font I can use that has this as a character? If I use 'UseSystemPasswordChar = true' it…
Edwin de Koning
  • 14,209
  • 7
  • 56
  • 74
88
votes
20 answers

Specifying maxlength for multiline textbox

I'm trying to use asp: I want a way to specify the maxlength property, but apparently there's no way possible for a multiline textbox. I've been trying to use some…
Blerta
  • 2,170
  • 5
  • 23
  • 34
86
votes
7 answers

Add padding to HTML text input field

I want to add some space to the right of an so that there's some empty space on the right of the field. So, instead of , I'd get . So, same behavior just some empty space to the right. I've tried using padding-right, but that…
Nathan
  • 6,772
  • 11
  • 38
  • 55
86
votes
11 answers

Set the caret/cursor position to the end of the string value WPF textbox

I am try to set the caret/cursor position to the end of the string value in my WPF textbox when I open my window for the first time. I use the FocusManager to set the focus on my textbox when my window opens. Nothing seems to work. Any…
Zamboni
  • 7,897
  • 5
  • 43
  • 52
83
votes
4 answers

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 textbox, yet make it appear as if it is enabled, so that the scroll bar works correctly?
HelpNeeder
  • 6,383
  • 24
  • 91
  • 155
82
votes
2 answers

Is there any difference between WPF TextBlock and TextBox?

What criteria must I consider when selecting one of these two controls?
Irfan
  • 2,713
  • 3
  • 29
  • 43
81
votes
3 answers

Adding space between numbers

I'm trying to make a number input. I've made so my textbox only accepts numbers via this code: function isNumber(evt) { evt = (evt) ? evt : window.event; var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode > 31 &&…
user1768788
  • 1,265
  • 1
  • 10
  • 29
81
votes
7 answers

Aligning text and select boxes to the same width in CSS?

Ok this is seemingly impossible to get right. I have a text box and a select box. I want them to be the same width exactly so they line up on the left margin and the right margin.