Option ExplicitPrivate Sub Command1_Click() Print Text1.Text & ":欢迎你!"End SubPrivate Sub Command2_Click() EndEnd SubPrivate Sub Form_Load() Command1.Caption = "打印" Command2.Caption = "退出" Text1.Text = vbNullStringEnd Sub
运行效果: