让窗体“动”起来
?牐犑紫龋陆ㄒ桓龉こ蹋柚煤么疤宓拇笮 ⑽恢谩⒆痔寮白痔逖丈H缓笤诖疤迳咸砑右桓黾剖逼鳌=酉吕淳褪潜嘈慈缦碌某绦虼耄?
?牐燚im words As String '定义一个变量,用来存储窗体的标题
?牐燚im i As Integer
?牐燚im txtword As String '定义一个变量,用来存储标题中的单个字符
?牐燚im lenth As Integer '定义此变量用来存储窗体标题的长度
?牐燩rivate Sub Form_Load()?煟?
?牐燤e.Caption = "如何创建动态显示的窗体标题" '此标题根据实际窗体设置
?牐爓ords = Form1.Caption
?牐燭imer1.Interval = 300
?牐燭imer1.Enabled = True '启用定时器
?牐燜orm1.Caption = "" '将窗体标题清空
?牐燛nd Sub
?牐燩rivate Sub Timer1_Timer()?煟?
?牐爈enth = Len(words)??
?牐爐xtword = Left(words,i)'取得窗体标题的前第i个字符
?牐燜orm1.Caption = txtword '动态设置窗体的标题
?牐爄 = i + 1
?牐營f i > lenth Then '窗体标题显示完毕,循环动态显示窗体标题
?牐爄 = 0
?牐燛nd If
?牐燛nd Sub
?牐牳峡彀聪翭5运行一下,看看效果如何吧!