古詩詞大全網 - 藝術簽名 - VB制作抽簽程序

VB制作抽簽程序

Public?j?As?Integer

Dim?A()?As?String

Dim?tem?As?String

Private?Sub?CMD1_Click()?'註意這裏如果沒有exit?sub,責會出現captio不會變的,其實已經變過了

If?CMD1.Caption?=?"開始"?Then

CMD1.Caption?=?"停止"

Timer1.Enabled?=?True

Exit?Sub

End?If

If?CMD1.Caption?=?"停止"?Then

CMD1.Caption?=?"開始"

Timer1.Enabled?=?False

If?tem?<>?""?Then

Text1.Text?=?tem

End?If

End?If

End?Sub

Private?Sub?CMD2_Click()

Frame1.Visible?=?True

Text2.Visible?=?True

CMD3.Visible?=?True

CMD4.Visible?=?True

End?Sub

Private?Sub?CMD3_Click()

Text2.Visible?=?False

CMD3.Visible?=?False

CMD4.Visible?=?False

tem?=?Text2.Text

End?Sub

Private?Sub?CMD4_Click()

Text2.Text?=?""

Text2.Visible?=?False

CMD3.Visible?=?False

CMD4.Visible?=?False

End?Sub

Private?Sub?form_load()

Frame1.Visible?=?False

Text2.Visible?=?False

CMD3.Visible?=?False

CMD4.Visible?=?False

Timer1.Enabled?=?False

Timer1.Interval?=?300

Open?"C:\Documents?and?Settings\Administrator\桌面\新建?文本文檔.txt"?For?Input?As?1

Do?Until?EOF(1)

ReDim?Preserve?A(0?To?I)

Input?#1,?A(I)

I?=?I?+?1

Loop

Close?#1

End?Sub

Private?Sub?Timer1_Timer()

Text1.Text?=?A(j)

j?=?j?+?1

If?j?=?UBound(A)?Then

j?=?0

End?If

End?Sub

已經運行通過,不過事先妳得在桌面建立壹個文本文件,用來存儲數據,呵呵