VB问题~急急急急急急急·

来源:百度知道 编辑:UC知道 时间:2024/07/05 13:43:39
当用户在文本框中输入姓名,例如输入“张三”,单击“确定”按钮,form中就有“张三,欢迎来到我的第一个程序”如果单击“结束”按钮,即结束程序运行。~~~~~~请大家帮我把代码详细发上来~~30分~
如何把text框按“确定”后去掉;;;按“确定”前“结束”健变暗,按“确定”后“结束”健变亮

private sub command1_click()
print text1.text;",欢迎来到我的第一个程序"
end sub

private sub command2_click()
end
end sub

'结束按钮 

Private Sub cmdCanael_Click() 

Unload Me 

End Sub 

'确定按钮 

Private Sub cmdOK_Click() 

Dim tempstr As String 

If Len(Trim(txtVal.Text)) > 0 Then 

tempstr = Trim(txtVal.Text) & ",欢迎来到我的第一个程序" 

'窗口标题模式 

Me.Caption = tempstr 

'对话框模式 

MsgBox tempstr 

'窗体Print 模式 

Me.Print tempstr 

'Label模式 

Label1.Caption = tempstr 

End If 

End Sub