visual basic,做一个文本框

img


标签是随便点的,因为没有vb这个标签,还请见谅。(括号内的是凑字数的)

'form的源文件
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   1455
   ClientLeft      =   120
   ClientTop       =   465
   ClientWidth     =   3690
   LinkTopic       =   "Form1"
   ScaleHeight     =   1455
   ScaleWidth      =   3690
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton Command1 
      Caption         =   "清除"
      Height          =   495
      Index           =   1
      Left            =   2280
      TabIndex        =   3
      Top             =   720
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "欢迎"
      Height          =   495
      Index           =   0
      Left            =   2280
      TabIndex        =   2
      Top             =   120
      Width           =   1095
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   360
      TabIndex        =   0
      Top             =   720
      Width           =   1575
   End
   Begin VB.Label Label1 
      Caption         =   "你的姓名"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   495
      Left            =   360
      TabIndex        =   1
      Top             =   240
      Width           =   1335
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click(Index As Integer)
If Index = 0 Then
    Text1.Text = "欢迎你," & Text1.Text
Else
    Text1.Text = ""
End If
End Sub


1、这个是基础问题啊,建议你看看帮助文件,或者查找下控件的使用帮助或者例程吧,或者找一本最基础的书籍看看,都能解决的。