1.模拟对话程序
【程序源码】
1 Option Explicit 2 3 Private Sub Command1_Click() 4 Text2.Text = "" 5 Text1.Text = "How are you!" 6 End Sub 7 8 9 Private Sub Command2_Click() 10 Text1.Text = "" 11 Text2.Text = "I am Fine!" 12 End Sub
【功能实现】
点击【对话甲】
点击【对话乙】
2.设计数字时钟程序
【程序源码】
Option Explicit Private Sub Timer1_Timer() Label1.Caption = Time End Sub
将Timer1控件的Interval设置为1000ms
3.进度条程序【改变字体的大小】
【程序源码】
Option Explicit Private Sub HScroll1_Change() Label1.Caption = HScroll1.Value Text1.FontSize = HScroll1.Value End Sub
4.VB程序设计的一般方法和步骤
(1)设计界面
(2)编写程序