banner



How Do You Make A Label Control's Text Display Bold Characters?

VB.Net - TextBox Command


Text box controls allow entering text on a grade at runtime. By default, it takes a single line of text, all the same, you can make it take multiple texts and even add curl confined to it.

Allow'due south create a text box by dragging a Text Box command from the Toolbox and dropping it on the grade.

VB.Net Text Box Control

The Backdrop of the TextBox Control

The post-obit are some of the usually used properties of the TextBox control −

Sr.No. Property & Description
1

AcceptsReturn

Gets or sets a value indicating whether pressing ENTER in a multiline TextBox control creates a new line of text in the control or activates the default button for the form.

2

AutoCompleteCustomSource

Gets or sets a custom Arrangement.Collections.Specialized.StringCollection to use when the AutoCompleteSourceproperty is set to CustomSource.

3

AutoCompleteMode

Gets or sets an option that controls how automatic completion works for the TextBox.

four

AutoCompleteSource

Gets or sets a value specifying the source of consummate strings used for automatic completion.

five

CharacterCasing

Gets or sets whether the TextBox control modifies the case of characters every bit they are typed.

6

Font

Gets or sets the font of the text displayed past the control.

7

FontHeight

Gets or sets the acme of the font of the control.

eight

ForeColor

Gets or sets the foreground color of the control.

9

Lines

Gets or sets the lines of text in a text box control.

10

Multiline

Gets or sets a value indicating whether this is a multiline TextBox command.

11

PasswordChar

Gets or sets the character used to mask characters of a password in a unmarried-line TextBox control.

12

ReadOnly

Gets or sets a value indicating whether text in the text box is read-only.

xiii

ScrollBars

Gets or sets which coil confined should appear in a multiline TextBox control. This property has values −

  • None
  • Horizontal
  • Vertical
  • Both
14

TabIndex

Gets or sets the tab order of the control within its container.

15

Text

Gets or sets the current text in the TextBox.

16

TextAlign

Gets or sets how text is aligned in a TextBox command. This property has values −

  • Left
  • Right
  • Center
17

TextLength

Gets the length of text in the command.

18

WordWrap

Indicates whether a multiline text box control automatically wraps words to the beginning of the next line when necessary.

The Methods of the TextBox Control

The following are some of the ordinarily used methods of the TextBox control −

Sr.No. Method Name & Description
1

AppendText

Appends text to the current text of a text box.

2

Articulate

Clears all text from the text box command.

3

Copy

Copies the current selection in the text box to the Clipboard.

4

Cut

Moves the electric current pick in the text box to the Clipboard.

v

Paste

Replaces the electric current choice in the text box with the contents of the Clipboard.

6

Paste(String)

Sets the selected text to the specified text without clearing the undo buffer.

7

ResetText

Resets the Text property to its default value.

8

ToString

Returns a string that represents the TextBoxBase control.

nine

Disengage

Undoes the last edit performance in the text box.

Events of the TextBox Control

The post-obit are some of the commonly used events of the Text command −

Sr.No. Upshot & Description
1

Click

Occurs when the control is clicked.

2

DoubleClick

Occurs when the command is double-clicked.

3

TextAlignChanged

Occurs when the TextAlign holding value changes.

Example

In this instance, we create three text boxes and employ the Click event of a push to display the entered text using a message box. Accept the following steps −

  • Drag and drop iii Label controls and 3 TextBox controls on the form.

  • Alter the texts on the labels to: Proper name, Arrangement and Comments, respectively.

  • Alter the names of the text boxes to txtName, txtOrg and txtComment, respectively.

  • Elevate and driblet a button command on the class. Prepare its name to btnMessage and its text holding to 'Transport Message'.

  • Click the button to add the Click issue in the code window and add the post-obit lawmaking.

Public Class Form1    Individual Sub Form1_Load(sender Equally Object, e Every bit EventArgs) _        Handles MyBase.Load       ' Set the explanation bar text of the form.         Me.Text = "tutorialspont.com"    End Sub         Private Sub btnMessage_Click(sender As Object, e As EventArgs) _    Handles btnMessage.Click       MessageBox.Show("Cheers " + txtName.Text + " from " + txtOrg.Text)    Finish Sub End Grade        

When the to a higher place code is executed and run using Start push button available at the Microsoft Visual Studio tool bar, it will bear witness the following window −

Result Form

Clicking the Send Message button would show the following message box −

Result Form

vb.net_basic_controls.htm

How Do You Make A Label Control's Text Display Bold Characters?,

Source: https://www.tutorialspoint.com/vb.net/vb.net_textbox.htm

Posted by: kesslernecomanis.blogspot.com

0 Response to "How Do You Make A Label Control's Text Display Bold Characters?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel