VB2005(Timer控件)
定時(shí)器控件主要用來計(jì)時(shí)。通過計(jì)時(shí)處理,可以實(shí)現(xiàn)各種復(fù)雜的操作。例如:延時(shí)、動(dòng)畫等。 Timer控件的常用屬性和事件 Timer控件的常用屬性不是狠多,比較常用的是Interval(間隔)屬性,該屬性值決定兩次調(diào)用Timer控件的間隔毫秒數(shù)。Enabled屬性用來控制定時(shí)器控件是否有效,該控件運(yùn)行時(shí)是不可見的。 定時(shí)器控件的屬性雖然不多,但其在動(dòng)畫制作、定期執(zhí)行某個(gè)操作等方面起著重要作用。 定時(shí)器控件的事件只有一個(gè)Tick。用戶可以通過捕捉該事件來對(duì)事件進(jìn)行操作。 Public Class Form12 Dim filesave As Boolean Private Sub Form12_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged |
|