

Use the CharacterCasing property to enable the user to type only uppercase, only lowercase, or a combination of uppercase and lowercase characters into the TextBox control. You can use the PasswordChar property to mask characters entered in a single-line version of the control. TextBox controls can also be used to accept passwords and other sensitive information.

You can limit the amount of text entered into a TextBox control by setting the MaxLength property to a specific number of characters. You can adjust the height by setting the Size property. You must set the Multiline property to true to adjust the height of the TextBox control. Set the AcceptsTab and AcceptsReturn properties to true to enable greater text manipulation in a multiline TextBox control. You can use the Multiline and ScrollBars properties to enable multiple lines of text to be displayed or entered. Typically, a TextBox control is used to display, or accept as input, a single line of text. This control has additional functionality that is not found in the standard Windows text box control, including multiline editing and password character masking. With the TextBox control, the user can enter text in an application. This.ClientSize = new (284, 264) Īpplication.SetCompatibleTextRenderingDefault(false)

This example uses the AcceptsTab, AcceptsReturn, and Dock properties to make the multiline text box control useful for creating text documents. The following code example creates a multiline TextBox control with vertical scroll bars. ClassInterfaceAttribute ComVisibleAttribute Examples
