最简单的VB问题,文本框总是先显示Label1,然后再显示想要显示的文字,为什么呢?如下是代码。

Private Sub Command1_Click() Label1.Caption = "我爱VB"End SubPrivate Sub Command2_Click() EndEnd SubPrivate Sub Form_Load() Me.Caption = "第二个VB程序" Label1.Font = "微软雅黑" Label1.FontSize = "64" Label1.FontBold = True Label1.ForeColor = vbRed Label1.FontUnderline = True Command1.Caption = "继续" Command1.FontSize = "32" Command1.FontName = "微软雅黑" Command2.Caption = "退出" Command2.FontSize = "32" Command2.Font = "微软雅黑"End Sub

Private Sub Command1_Click()
Label1.Caption = "我爱VB"
End Sub
因为你这个文字是在command1_click事件之后啊。你不点击这个按钮,它就永远不会出来的。朋友追问

那要怎么直接显示我爱vb呢?或者,怎样隐藏掉“label1”呢?

温馨提示:内容为网友见解,仅供参考
第1个回答  2017-08-15
直接写在form的窗口里
Private Sub Form_Load()
Label1.Caption = Now
Timer2.Enabled = True
Timer2.Interval = 1000
End Sub
这样就可以了。。
相似回答