VB中, 我想让label控件慢慢显示出来,有没有办法?

来源:百度知道 编辑:UC知道 时间:2024/05/31 11:32:20
像幻灯片一样,慢慢地显示出来.有没有办法...求代码(图片我知道代码,却不知道控件)

可以

Dim i%
Private Sub Form_Load()
i = 255
With Label1
.Caption = "这是一行测试代码!"
.AutoSize = True
.FontSize = 22
.ForeColor = RGB(i, 255, 255)
.BackStyle = 0
End With
Me.BackColor = RGB(255, 255, 255)
Timer1.Enabled = True
Timer1.Interval = 50
End Sub

Private Sub Timer1_Timer()
i = i - 5
Label1.ForeColor = RGB(i, i, i)
If i = 0 Then Timer1.Enabled = False
End Sub

'不要那么复杂的
'添加窗体Form1,卷标Label1,然后添加如下代码:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Form_Click()
    Dim i%
    i = 200
    Do While (i > 0)
        DoEvents
        Label1.For