VB的問題 KTV逐漸顯示字幕

Private Sub cmdStart_Click()

Timer1.Enabled = True

End Sub

Private Sub Form_Load()

Timer1.Enabled = False

Form1.Show

Picture1.ForeColor = vbBlue '設其前景色為藍色

Picture2.ForeColor = vbRed '設其前景色為紅色

Picture2.Print "塵緣如夢,幾番起伏總不平"

Picture1.Print "塵緣如夢,幾番起伏總不平"

Picture1.Top = Picture2.Top '使Picture1與Picture

Picture1.Left = Picture2.Left '重疊

Picture1.Width = 0 '將Picture1之寬度設為0

Picture1.ZOrder 0 '將Picture1置於最上層

End Sub

Private Sub Timer1_Timer()

If Picture1.Width < Picture2.Width Then

Picture1.Width = Picture2.Width

Picture1.Cls

Picture1.Print "塵緣如夢,幾番起伏總不平"

End If

End Sub

字幕不會改變

想把紅色逐漸變藍色

然後我把Timer1 Timer的Interval調成300

結果變成0.3秒顯示全部藍色字幕

想要一個一個字變成藍色就像是KTV的那種

用好久也看不出個所以然

Update:

字幕由左向右變化

1 Answer

Rating
  • 1 decade ago
    Favorite Answer

    Private Sub Command1_Click()

    Timer1.Enabled = True

    End Sub

    Private Sub Form_Load()

    Timer1.Enabled = False

    Form1.Show

    Picture1.ForeColor = RGB(0, 0, 255) '設其前景色為藍色

    Picture2.ForeColor = RGB(255, 0, 0) '設其前景色為紅色

    Picture2.Print "塵緣如夢,幾番起伏總不平"

    Picture1.Top = Picture2.Top '使Picture1與Picture

    Picture1.Left = Picture2.Left '重疊

    Picture1.Width = 0 '將Picture1之寬度設為0

    Picture1.ZOrder 0 '將Picture1置於最上層

    End Sub

    Private Sub Timer1_Timer()

    If Picture1.Width < Picture2.Width Then

    Picture1.Width = Picture1.Width + 150

    Picture1.Cls

    Picture1.Print "塵緣如夢,幾番起伏總不平"

    End If

    End Sub

    這是TQC的題目吧!你試試看吧..

    這是你要的嗎?不懂可以問我喔!

    Source(s): 自己
    • Login to reply the answers
Still have questions? Get your answers by asking now.