现将设计的整个过程介绍如下:
(1)创建一个新目标文件(Project1),并建立一个窗体Form1。
(2)在Form1上配置一个计时器控件Timer1、标签控件Label1、图像控件Picture1。
(3)各控件属性设置:
Timer1的Enabled设置为“True”。
用Label1的Font设置屏幕下方循环移动的提示信息字体及大小,ForeColor设置字体颜色,AutoSize设置为True,BackStyle设置为“0-transparent”。
Picture1的AutoSize设置为False,Height设为5435,Width设为8235,Scalemode设置为“3-pixel”。
(4)程序代码清单:
Private Sub Form_Load()
′设置图像控件Picture1属性,在屏幕显示图像 Picture1?
Picture=LoadPicture(″C:\Pwin95\Setup.bmp″)
Picture1?ForeColor=RGB(255,10,110)
Picture1?FontItalic=TruePicture1?
FontBold=True
Picture1?Top=155Picture1?Left=635′将标签控件Label1的Caption属性设置为屏幕下方循环移动的提示信息
Label1?Caption=″江西省黎川县职业中专电脑室设计″
Label1?Left=WidthLabel1?Top=5653Timer1?Interval=375Form1?Windowstate=2
End Sub
Private Sub Timer1_Timer()
If Label1?Left<0-Label1?Width Then
Label1?Left=WidthEndIfLabel1? Left=Label1?Left-255
End Sub
程序中的图像及移动字幕可依自己喜好灵活设计,以达到最佳效果。若屏幕显示多幅图像,需设置好几个图像控件Picture的屏幕显示位置,分别调用函数LoadPicture(″.bmp文件名″)即可。该程序设计也适用VB3.0、VB4.0
评论 {{userinfo.comments}}
{{child.content}}
{{question.question}}
提交