In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "VB.NET how to use TextBox class", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "VB.NET how to use TextBox class" this article.
The TextBox component (text box component) is a commonly used component that is relatively easy to master. Applications mainly use it to receive text messages entered by users. I have come into contact with TextBox components more or less in the previous content. This section discusses in detail how to use TextBox components in Visual Basic. Net.
1. TextBox components and VB.NET TextBox classes:
When we use the Visual Basic .net integrated development environment to develop applications, after dragging a TextBox component from the Windows forms tab of the Toolbox to Form1's design form, we may not feel that Visual Basic .net has done a lot of behind-the-scenes work even with such a simple operation. The main work and steps are as follows:
1. First instantiate the System.Windows.Forms.TextBox class and set the properties of the TextBox instance based on the location and shape of the drag onto the form.
two。 The design form we see is actually an instance of the Form1 class, and the Form1 class is first inherited from the System.Windows.Forms.Form class, and the members of the Form1 class vary depending on the components the user drags into the form. Each member is added to the Form1 through the Add or AddRange method so that the dragged component can be displayed on the design form.
All of these are completely different from the previous Visual Basic. Through the above steps, it is not difficult to get the relationship between the TextBox component and the TextBox class. The TextBox component is an instance of the TextBox class in the namespace System.Windows.Forms, and any component dragged into the form from the [Windows forms] tab of the [toolbox] is an instance of a class encapsulated in the .net framework class library. Net Framework SDK. From the above steps, it is not difficult to see that Visual Basic .net is indeed the real object-oriented (OOP) development language.
II. Members of the VB.NET TextBox class:
Although the TextBox component is relatively easy to use, the constituent members of the TextBox class are very rich. In general programming, there are three main categories: properties, methods, and events. The following intercepts the common properties and methods of the VB.NET TextBox class and their simple instructions.
Property description AcceptsReturn indicates whether to create a new line of text in the component or the default button to activate the form when the enter key is pressed in the multiline TextBox component. AcceptsTab this value indicates whether to type a TAB character in the component when the TAB key is pressed in the multiline text box component, rather than moving the focus to the next component in tab order. AllowDrop gets or sets a value indicating whether the component can accept data that users drag and drop onto it. Anchor gets or sets which edges of the component are anchored to the edges of its container. BackColor gets or sets the background color of the component. BackgroundImage gets or sets the background image displayed in the component. BorderStyle gets or sets the border type of the text box component. Bottom gets the distance between the lower edge of the component and the upper edge of the client area of its container. CanFocus gets a value indicating whether the component can receive focus. CanSelect gets a value indicating whether the component can be selected. CanUndo gets a value indicating whether the user can undo the previous action in the text box component. CharacterCasing gets or sets whether the TextBox component modifies its case format as the character is typed. ContextMenu gets or sets the shortcut menu associated with the component. Reated gets a value indicating whether the component has been created. Cursor gets or sets the cursor that is displayed when the mouse pointer is over the component. DataBindings gets the data binding for the component. Dock gets or sets the edge to which the component is docked to the parent container. Enabled gets or sets a value indicating whether the component can respond to user interaction. Focused gets a value indicating whether the component has input focus. Font gets or sets the font of the text displayed by the component. ForeColor gets or sets the foreground color of the component. MaxLength gets or sets the maximum number of characters that users can type in the text box component. MultilineTRUE/FALSE, which indicates whether it is a multiline text box component. PasswordChar gets or sets a character that is used to mask a single-line ScrollBars to get or set which scroll bars should appear in a multiline TextBox component. Text gets or sets the current text in the text box. TextAlign sets the alignment of text in the text box TextLength gets the length of the text in the component.
Common properties of VB.NET TextBox class and their descriptions
Method describes how AppendText appends text to the current text of the text box. Clear clears all text from the text box control. ClearUndo clears information about recent actions from the undo buffer of the text box. Copy copies the current selection in the text box to the clipboard. Cut moves the current selection in the text box to the clipboard. DoDragDrop starts the drag and drop operation. Focus sets the input focus for the control. GetChildAtPoint retrieves the child control at the specified coordinates. GetNextControl retrieves the next control forward or backward in the order of the Tab key of the child control. Hide hides the control from the user. Paste replaces the current selection in the text box with the contents of the clipboard. PointToClient calculates the location of the specified screen point as workspace coordinates. PointToScreen calculates the location of the specified workspace point as screen coordinates. ResetBindings resets the DataBindings property to its default value. Select selects the text in the control. SelectAll all text in the selected text box. SelectNextControl activates the next control. Show displays the control to the user. SuspendLayout temporarily suspends the layout logic of the control. Undo undoes the last edit operation in the text box.
Common methods of VB.NET TextBox class and their explanation
These are all the contents of the article "how VB.NET uses TextBox classes". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.