System.Windows.Forms
2.0.0.0
System.Windows.Forms.ToolStripControlHost
is the optimized for hosting in a . A subset of the hosted control's properties and events are exposed at the level, but the underlying control is fully accessible through the property.
The control allows the user to enter text in an application. This control has additional functionality that is not found in the standard Windows text box control, including multiline editing.
Typically, a control is used to display a single line of text or accept it as input. You can use the to enable multiple lines of text to be displayed or entered. Set the and properties to true to allow greater text manipulation in a multiline control.
You can limit the amount of text entered into a control by setting the property to a specific number of characters. Use the property to allow the user to type only uppercase, only lowercase, or a combination of uppercase and lowercase characters into the control.
To restrict text from being entered in a control, you can create an event handler for the event in order to validate each character entered in the control. You can also restrict all entry of data in a control by setting the property to true.
Represents a text box in a that allows the user to enter text.
Constructor
To be added.
Initializes a new instance of the class.
2.0.0.0
Constructor
To be added.
Initializes a new instance of the class with the specified name.
The name of the .
2.0.0.0
Constructor
To be added.
Initializes a new instance of the class derived from a base control.
The control from which to derive the .
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
Property
System.ComponentModel.DefaultValue(false)
System.Boolean
To be added.
If the value of this property is false, the user must press CTRL+ENTER to create a new line in a multiline control. If there is no default button for the form, then the ENTER key will always create a new line of text in the control, no matter what the value of this property.
Gets or sets a value indicating whether pressing ENTER in a multiline control creates a new line of text in the control or activates the default button for the form.
2.0.0.0
Property
System.ComponentModel.DefaultValue(false)
System.Boolean
To be added.
If the property is set to true, the user must press CTRL+TAB to move the focus to the next control in the tab order.
Gets or sets a value indicating whether pressing the TAB key in a multiline text box control types a TAB character in the control instead of moving the focus to the next control in the tab order.
2.0.0.0
Event
System.EventHandler
For more information about handling events, see Consuming Events.
Occurs when the value of the property changes.
2.0.0.0
Method
System.Void
To be added.
Appends text to the current text of the .
The text to append to the current contents of the .
2.0.0.0
Property
2.0.0.0
System.ComponentModel.Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Always)
System.ComponentModel.Localizable(true)
System.ComponentModel.Browsable(true)
System.Windows.Forms.AutoCompleteStringCollection
To be added.
Use the , , and properties to create a that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for controls in which URLs, addresses, file names, or commands will be frequently entered.
The use of the property is optional, but you must set the property to CustomSource in order to use .
You must use the and properties together.
Gets or sets a custom string collection to use when the property is set to CustomSource.
Property
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Always)
System.ComponentModel.DefaultValue(System.Windows.Forms.AutoCompleteMode.None)
System.ComponentModel.Browsable(true)
System.Windows.Forms.AutoCompleteMode
To be added.
Use the , , and properties to create a that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for controls in which URLs, addresses, file names, or commands will be frequently entered.
The use of the property is optional, but you must set the property to CustomSource in order to use .
You must use the and properties together.
Gets or sets an option that controls how automatic completion works for the .
Property
2.0.0.0
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Always)
System.ComponentModel.DefaultValue(System.Windows.Forms.AutoCompleteSource.None)
System.ComponentModel.Browsable(true)
System.Windows.Forms.AutoCompleteSource
To be added.
Use the , , and properties to create a that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for controls in which URLs, addresses, file names, or commands will be frequently entered.
The use of the property is optional, but you must set the property to CustomSource in order to use .
You must use the and properties together.
Gets or sets a value specifying the source of complete strings used for automatic completion.
Property
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
System.ComponentModel.Browsable(false)
System.Drawing.Image
To be added.
This property is not relevant to this class.
This property is not relevant to this class.
Property
2.0.0.0
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
System.ComponentModel.Browsable(false)
System.Windows.Forms.ImageLayout
To be added.
This property is not relevant to this class.
This property is not relevant to this class.
Property
System.Runtime.InteropServices.DispId(-504)
System.ComponentModel.DefaultValue(System.Windows.Forms.BorderStyle.Fixed3D)
System.Windows.Forms.BorderStyle
To be added.
You can use the property to create borderless and flat style controls, in addition to the default three-dimensional control.
Gets or sets the border type of the control.
2.0.0.0
Event
System.EventHandler
For more information about handling events, see Consuming Events.
Occurs when the value of the property changes.
2.0.0.0
Property
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
System.Boolean
To be added.
If this method returns true, you can call the method to undo the last operation in a .
Gets a value indicating whether the user can undo the previous operation in a control.
2.0.0.0
Property
System.ComponentModel.DefaultValue(System.Windows.Forms.CharacterCasing.Normal)
System.Windows.Forms.CharacterCasing
To be added.
You can use the property to change the case of characters as required by your application.
Gets or sets whether the control modifies the case of characters as they are typed.
2.0.0.0
Method
System.Void
To be added.
Clears all text from the control.
2.0.0.0
Method
System.Void
You can use this method to prevent an undo operation from repeating, based on the state of your application.
Clears information about the most recent operation from the undo buffer of the .
2.0.0.0
Method
System.Void
You can use this method, instead of using the class, to copy text in the and place it in the Clipboard.
Copies the current selection in the to the Clipboard.
2.0.0.0
Method
System.Void
This method will only cut text from the if text is selected in the control. You can use this method, instead of using the class, to copy text in the and move it to the Clipboard.
Moves the current selection in the to the Clipboard.
2.0.0.0
Property
2.0.0.0
System.Windows.Forms.Padding
To be added.
To be added.
Gets the spacing, in pixels, between the and adjacent items.
Property
System.Drawing.Size
To be added.
In order to maintain better performance, you should not set the of a in its constructor. The preferred method is to override the property.
Gets the default size of the .
2.0.0.0
Method
2.0.0.0
System.Void
To be added.
Specifies that the value of the property is zero so that no characters are selected in the control.
Method
2.0.0.0
System.Char
If the location specified in the parameter is outside the client area of the control, the first character of the string closest to the point specified in is returned. You can use this method to determine which characters are located near a specific point within the control. You can then use this value to perform operations on the text at that location.
If the specified location in the parameter is located on the right side of the client area of the control, the last character of the string closest to the point specified in is returned.
Retrieves the character that is closest to the specified location within the control.
The character at the specified location.
The location from which to seek the nearest character.
Method
2.0.0.0
System.Int32
This method returns the character index that is closest to the position specified in the parameter. The character index is a zero-based index of text in the control, including spaces. You can use this method to determine where in the text the user has the mouse over by passing the mouse coordinates to this method. This can be useful if you want to perform tasks when the mouse pointer hovers over a word in the text of the control.
Retrieves the index of the character nearest to the specified location.
The zero-based character index at the specified location.
The location to search.
Method
2.0.0.0
System.Int32
If the parameter is negative, returns 0. If the parameter exceeds the number of lines in the control, returns the first character index for the last line in the control.
returns the first character index of a physical line. The physical line is the displayed line, not the assigned line. The number of displayed lines can be greater than the number of assigned lines due to word wrap. For example, if you assign two long lines to a control and set and to true, the two long assigned lines result in four physical (or displayed lines).
Retrieves the index of the first character of a given line.
The zero-based character index in the specified line.
The line for which to get the index of its first character.
Method
2.0.0.0
System.Int32
To be added.
Retrieves the index of the first character of the current line.
The zero-based character index in the current line.
Method
2.0.0.0
System.Int32
This method enables you to determine the line number based on the character index specified in the parameter of the method. The first line of text in the control returns the value zero. The method returns the physical line number where the indexed character is located within the control. For example, if a portion of the first logical line of text in the control wraps to the next line, the method returns 1 if the character at the specified character index has wrapped to the second physical line. If is set to false, no portion of the line wraps to the next, and the method returns 0 for the specified character index. You can use this method to determine which line a specific character index is located within. For example, after calling the method to search for text, you can obtain the character index to where the search results are found. You can call this method with the character index returned by the method to determine which line the word was found.
If the character index specified in the parameter is beyond the available number of lines contained within the control, the last line number is returned.
Retrieves the line number from the specified character position within the text of the control.
The zero-based line number in which the character index is located.
The character index position to search.
Method
2.0.0.0
System.Drawing.Point
This method enables you to determine where in the control a specific character index is located. You can use this method for such tasks as displaying shortcut menu items or help information for a word in the control. For example, if you wanted to display a menu of options to the user when the user right clicks on a word in the control, you can use this method to determine the position of the word to properly display a control.
Retrieves the location within the control at the specified character index.
The location of the specified character.
The index of the character for which to retrieve the location.
Method
System.Drawing.Size
To be added.
To be added.
To be added.
To be added.
2.0.0.0
Property
System.ComponentModel.DefaultValue(true)
System.Boolean
To be added.
You can use this property to keep text highlighted in a text box control while another form or a dialog box has focus, such as a spelling checker dialog box.
Gets or sets a value indicating whether the selected text in the text box control remains highlighted when the control loses focus.
2.0.0.0
Event
System.EventHandler
For more information about handling events, see Consuming Events.
Occurs when the value of the property changes.
2.0.0.0
Property
System.ComponentModel.Editor("System.Windows.Forms.Design.StringArrayEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Localizable(true)
System.String[]
To be added.
Each element in the array becomes a line of text in the text box control. If the property of the text box control is set to true and a newline character appears in the text, the text following the newline character is added to a new element in the array and displayed on a separate line.
Gets or sets the lines of text in a control.
2.0.0.0
Property
System.ComponentModel.DefaultValue(32767)
System.ComponentModel.Localizable(true)
System.Int32
To be added.
You can use this property to restrict the length of text entered in the control for values such as postal codes and telephone numbers, or to restrict the length of text entered when the data is to be entered in a database. You can limit the text entered into the control to the maximum length of the corresponding field in the database.
Gets or sets the maximum number of characters the user can type or paste into the text box control.
2.0.0.0
Property
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
System.Boolean
To be added.
You can use this property to determine if the user has modified the contents of the control. You can also set this property in code to indicate that changes were made to the control by the application. This property can be used by validation and data-saving methods to determine if changes were made in a control so the changed contents can be validated or saved.
Gets or sets a value that indicates that the control has been modified by the user since the control was created or its contents were last set.
2.0.0.0
Event
System.EventHandler
For more information about handling events, see Consuming Events.
Occurs when the value of the property changes.
2.0.0.0
Property
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
System.ComponentModel.DefaultValue(false)
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
System.ComponentModel.Browsable(false)
System.ComponentModel.Localizable(true)
System.Boolean
To be added.
This property is not relevant to this class.
This property is not relevant to this class.
2.0.0.0
Event
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
System.ComponentModel.Browsable(false)
System.EventHandler
This event is not relevant to this class.
This event is not relevant to this class.
2.0.0.0
Method
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
A that contains the event data.
2.0.0.0
Method
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
A that contains the event data.
2.0.0.0
Method
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
A that contains the event data.
2.0.0.0
Method
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
A that contains the event data.
2.0.0.0
Method
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
A that contains the event data.
2.0.0.0
Method
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
A that contains the event data.
2.0.0.0
Method
System.Void
To be added.
To be added.
To be added.
2.0.0.0
Method
System.Void
To be added.
To be added.
To be added.
2.0.0.0
Method
System.Void
The method will only paste text into the control if text is currently stored in the Clipboard.
Replaces the current selection in the text box with the contents of the Clipboard.
2.0.0.0
Property
System.ComponentModel.DefaultValue(false)
System.Boolean
To be added.
When this property is set to true, the contents of the control cannot be changed by the user at runtime, but you can still change the contents in code. You can use this feature instead of disabling the control with the property to allow the contents to be copied.
Gets or sets a value indicating whether text in the is read-only.
2.0.0.0
Event
System.EventHandler
For more information about handling events, see Consuming Events.
Occurs when the value of the property changes.
2.0.0.0
Method
System.Void
This method enables you to scroll the contents of the control until the caret is within the visible region of the control. If the caret is positioned below the visible region of the control, the method will scroll the contents of the control until the caret is visible at the bottom of the control. If the caret is positioned above the visible region of the control, this method scrolls the contents of the control until the caret is visible at the top of the control. You can use this method in a multiline text box to ensure that the current text entry point is within the visible region of the control.
This method has no effect if the control does not have focus or if the caret is already positioned in the visible region of the control.
Scrolls the contents of the control to the current caret position.
2.0.0.0
Method
System.Void
If you want to set the start position to the first character in the control's text, set the parameter to 0. You can use this method to select a substring of text, such as when searching through the text of the control and replacing information.
You can programmatically move the caret within the text box by setting the parameter to the position within the text box where you want the caret to move to and set the parameter to a value of zero (0). The text box must have focus in order for the caret to be moved.
Selects a range of text in the text box.
The position of the first character in the current text selection within the text box.
The number of characters to select.
2.0.0.0
Method
System.Void
This method enables you to select all text within the control. You can use this method with the method, which requires text to be selected in the control, to cut the entire contents of the control and paste them into the Clipboard.
Selects all text in the text box.
2.0.0.0
Property
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
System.String
To be added.
You can assign text to this property to change the text currently selected in the. If no text is currently selected in the, this property returns a zero-length string.
Gets or sets a value indicating the currently selected text in the control.
2.0.0.0
Property
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
System.Int32
To be added.
You can use this property to determine if any characters are currently selected in the text box control before performing operations on the selected text. When the value of the property is set to a value that is larger than the number of characters within the text of the control, the value of the property is set to the entire length of text within the control minus the value of the property (if any value is specified for the property).
You can programmatically move the caret within the text box by setting the to the position within the text box where you want the caret to move to and set the property to a value of zero (0). The text box must have focus in order for the caret to be moved.
Gets or sets the number of characters selected in the.
2.0.0.0
Property
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
System.Int32
To be added.
If no text is selected in the control, this property indicates the insertion point for new text. If you set this property to a location beyond the length of the text in the control, the selection start position will be placed after the last character. When text is selected in the text box control, changing this property might decrease the value of the property. If the remaining text in the control after the position indicated by the property is less than the value of the property, the value of the property is automatically decreased. The value of the property never causes an increase in the property.
You can programmatically move the caret within the text box by setting the to the position within the text box where you want the caret to move to and set the property to a value of zero (0). The text box must have focus in order for the caret to be moved.
Gets or sets the starting point of text selected in the.
2.0.0.0
Property
2.0.0.0
System.ComponentModel.DefaultValue(true)
System.Boolean
To be added.
Use the property to enable or disable the following shortcut key combinations:
-
Shortcut keys
Shortcut keys
-
CTRL+Z
CTRL+E
-
CTRL+C
CTRL+I
-
CTRL+X
CTRL+Y
-
CTRL+V
CTRL+BACKSPACE
-
CTRL+A
CTRL+DELETE
-
CTRL+L
SHIFT+DELETE
-
CTRL+R
SHIFT+INSERT
You can override this property to specify other shortcut keys.
Gets or sets a value indicating whether the defined shortcuts are enabled.
Property
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
System.ComponentModel.Browsable(false)
System.Windows.Forms.TextBox
To be added.
To be added.
Gets the hosted control.
2.0.0.0
Property
System.ComponentModel.DefaultValue(System.Windows.Forms.HorizontalAlignment.Left)
System.ComponentModel.Localizable(true)
System.Windows.Forms.HorizontalAlignment
To be added.
You can use this property to align the text within a to match the layout of text on your form. For example, if your controls are all located on the right side of the form, you can set the property to , and the text will be aligned with the right side of the control instead of the default left alignment.
Gets or sets how text is aligned in a control.
2.0.0.0
Event
System.EventHandler
For more information about handling events, see Consuming Events.
Occurs when the value of the property changes.
2.0.0.0
Property
System.ComponentModel.Browsable(false)
System.Int32
To be added.
You can use the property to determine the number of characters in a string for tasks such as searching for specific strings of text within the text of the control, where knowledge of the total number of characters is needed.
Gets the length of text in the control.
2.0.0.0
Method
System.Void
This method will undo the last clipboard or text change operation performed in the text box control if the property returns true.
Undoes the last edit operation in the text box.
2.0.0.0
Property
System.ComponentModel.DefaultValue(true)
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)
System.ComponentModel.Browsable(false)
System.ComponentModel.Localizable(true)
System.Boolean
To be added.
This property is not relevant to this class.
This property is not relevant to this class.
2.0.0.0
System.Windows.Forms.Design.ToolStripItemDesignerAvailability(System.Windows.Forms.Design.ToolStripItemDesignerAvailability.ToolStrip | System.Windows.Forms.Design.ToolStripItemDesignerAvailability.MenuStrip | System.Windows.Forms.Design.ToolStripItemDesignerAvailability.ContextMenuStrip)