战网无法运行:VB高手快来!

来源:百度文库 编辑:高考问答 时间:2024/03/29 00:51:29
在一个窗体中,利用定时器控件(timer),控制这段文字"你好请帮帮我"在窗体中出现1分钟又消失1分钟,这题怎么做!

用1个Timer控件并将Timer控件的属性Interval设为60000约1分钟,代码如下:
Option Explicit
Dim timer_b As Boolean

Private Sub Timer1_Timer()
If timer_b Then
Label1.Caption = "你好,请帮帮我"
Else
Label1.Caption = ""
End If
timer_b = Not timer_b
End Sub

Dim nows, i As Integer

Private Sub Form_Load()
Print "你好,请帮帮我"
Me.AutoRedraw = True
End Sub

Private Sub Timer1_Timer()
i = i + 1
If i >= 60 Then
i = 0
If nows = 0 Then
Me.Cls
nows = 1
Else
Print "你好,请帮帮我"
nows = 0
End If
End If
End Sub

只需一个timer1,Interval为1000

可以用两个timer控件来实现,先把“你好请帮帮我”传给label1.text
先定义个变量i,j用来类加
在timer1的事件里写:
i+=1
if i=60 then
timer1.不可用
timer2.可用
i=0
else
label1.text(你好请帮帮我)可见

在timer2的事件里写:
j+=1
if j=60 then
timer1.可用
timer2.不可用
i=0
else
label1.text(你好请帮帮我)不可见

意思是如此我没装VB你试试

只用一个timer即可,先设一个布尔型的全局变量isshow,在form_load()事件中加入 ;isshow=true
然后在timer的事件中加入:

if isshow=true then
label1.caption=""你好,请帮帮我"
isshow=false
else
label1.caption=""
isshow=true
end if