private sub form_load()
command1.caption ="隐藏文本框"
command2.caption="显示文本框"
text1.text =""
end sub
private sub command1_click()
text1.visible =false
end sub
private sub command2_click()
text1.visible = true
text1.text="vb程序设计"
text1.fontsize = 16
end sub
private sub command1_click()
text1.visible =false
end sub
private sub command2_click()
text1.visible = true
text1.text="vb程序设计"
text1.fontsize = 16
end sub
两个按钮的Caption属性可以在右侧“属性”窗口中设置!
不必要在过程中使用语句!减少代码量!使代码更为简洁!
Private Sub Command1_Click()
Text1.Visible = False
End Sub
Private Sub Command2_Click()
Text1.Text = "vb程序设计"
Text1.Visible = True
End Sub
Private Sub Form_Load()
Command1.Caption = "隐藏文本框"
Command2.Caption = "显示文本框"
Text1.Text = ""
Text1.FontSize = 16
End Sub
Private Sub Command1_Click()
Text1.Visible = False
End Sub
Private Sub Command2_Click()
Text1.Text = "vb程序设计"
Text1.Visible = True
Text1.FontSize = 16
End Sub