Home  >  Article  >  VB code to clear text box

VB code to clear text box

angryTom
angryTomOriginal
2020-02-07 15:51:2123031browse

VB code to clear text box

VB code to clear the text box

You can clear the text box by setting TextBox.Text = "" content.

The following demonstrates this method

(1) Create a new VB project

(2) Arrange a TextBox and a Button on Form1

(3) Form code

Option Explicit
 
Private Sub Command1_Click()
    Text1.Text = ""
End Sub
 
Private Sub Form_Load()
    '设置Text1
    Text1.Text = ""
    '允许显示多行
    Text1.MultiLine = True
    '显示垂直滚动条
    Text1.ScrollBars = 2
End Sub

(4) Running effect

Enter text

VB code to clear text box

Click the button delete

VB code to clear text box

The above is the detailed content of VB code to clear text box. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn