📄 vb9.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0056)http://www.pconline.com.cn/experience/subject/VB/vb9.htm -->
<HTML><HEAD><TITLE>|><| 太平洋电脑信息网</TITLE><!-- #BeginTemplate "/Templates/0723.dwt" --><!-- #BeginEditable "doctitle" --><!-- #EndEditable -->
<META content="text/html; charset=gb2312" http-equiv=Content-Type><LINK
href="vb9.files/text.css" rel=stylesheet>
<STYLE type=text/css>.sfont {
LINE-HEIGHT: 18pt
}
</STYLE>
<META content="MSHTML 5.00.2014.210" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD vAlign=top width="100%">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR bgColor=#303880>
<TD><A href="http://www.pconline.com.cn/"><IMG alt=太平洋电脑信息网 border=0
height=18 hspace=30 src="vb9.files/txtpconline.gif"
width=96></A><IMG height=10 src="vb9.files/blank.gif"
width=400></TD></TR></TBODY></TABLE></TD>
<TD align=right background=vb9.files/bw.gif noWrap width=130><IMG
height=26 src="vb9.files/bw.gif" width=10><A
href="http://www.pconline.com.cn/sitemap/"><IMG alt=网站地图 border=0
height=26 src="vb9.files/sitemap.gif" width=21></A><IMG height=26
src="vb9.files/bw.gif" width=10><A
href="http://www.pconline.com.cn/tpy/"><IMG alt=关于太平洋 border=0 height=26
src="vb9.files/aboutus.gif" width=21></A><IMG height=26
src="vb9.files/bw.gif" width=10><A
href="http://www.pconline.com.cn/tpy/tariff.html"><IMG alt=与我们联系 border=0
height=26 src="vb9.files/contact.gif" width=21></A><IMG height=26
src="vb9.files/bw.gif" width=10></TD></TR></TBODY></TABLE><BR>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=760>
<TBODY>
<TR>
<TD bgColor=#666666><IMG height=1 src="vb9.files/blank.gif" width=1></TD>
<TD bgColor=#666666><IMG height=1 src="vb9.files/blank.gif" width=1></TD>
<TD> </TD>
<TD colSpan=2 noWrap><A
href="http://www.pconline.com.cn/experience/index.html"><IMG
align=absBottom alt=企业之窗 border=0 height=15
src="vb9.files/txtexperience.gif" width=68></A> <A
href="http://www.pconline.com.cn/">首 页</A> <A
href="http://www.pconline.com.cn/market/">今日报价</A> <A
href="http://www.pconline.com.cn/recommend/">产品推介</A> <A
href="http://www.pconline.com.cn/yp/">企业之窗</A> <A
href="http://www.pconline.com.cn/news/">科技新闻</A> <A
href="http://www.pconline.com.cn/product/">产品查询</A> <A
href="http://www.pconline.com.cn/download/">软件下载</A></TD></TR>
<TR>
<TD><IMG height=1 src="vb9.files/blank.gif" width=1></TD>
<TD><IMG height=1 src="vb9.files/blank.gif" width=1></TD>
<TD><IMG height=1 src="vb9.files/blank.gif" width=21></TD>
<TD bgColor=#ffa000 colSpan=2><IMG height=1 src="vb9.files/blank.gif"
width=1></TD></TR>
<TR>
<TD bgColor=#666666><IMG height=1 src="vb9.files/blank.gif" width=1></TD>
<TD bgColor=#cdcdcd><IMG height=5 src="vb9.files/blank.gif" width=1></TD>
<TD align=right colSpan=3><IMG height=6 src="vb9.files/ffa000.gif"
width=1></TD></TR>
<TR>
<TD bgColor=#666666><IMG height=1 src="vb9.files/blank.gif" width=1></TD>
<TD align=right><A href="http://www.pconline.com.cn/"><IMG alt=太平洋电脑信息网
border=0 height=35 src="vb9.files/pconline.com.cn.gif" vspace=10
width=162></A></TD>
<TD> </TD>
<TD vAlign=bottom><!-- #BeginEditable "important_news" --><IMG height=40
src="vb9.files/blank.gif" width=350><!-- #EndEditable --></TD>
<TD align=right vAlign=top><!-- #BeginEditable "adv_top" --><IMG alt=广告位
height=43 src="vb9.files/icon.gif"
width=190><!-- #EndEditable --></TD></TR></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=760>
<TBODY>
<TR>
<TD bgColor=#666666 width=1><IMG height=1 src="vb9.files/blank.gif"
width=1></TD>
<TD vAlign=top width=170><!-- #BeginEditable "addons" --><!--替代为附加信息 --><!-- #EndEditable --></TD>
<TD bgColor=#666666 width=1><IMG height=1 src="vb9.files/blank.gif"
width=1></TD>
<TD><IMG height=1 src="vb9.files/blank.gif" width=21></TD>
<TD colSpan=3 vAlign=top width=566><!-- #BeginEditable "1" --><IMG
height=1 src="vb9.files/blank.gif" width=566><BR><IMG height=1
src="vb9.files/666666.gif" width=420><BR><IMG height=13
src="vb9.files/blank.gif" width=1><A
href="http://www.pconline.com.cn/experience/">经验共享</A> > <SPAN
class=greenb><A
href="http://www.pconline.com.cn/experience/subject/VB/index.html">专题教程</A></SPAN><A
href="http://www.pconline.com.cn/experience/subject/VB/index.html">
VB专区</A>><BR><IMG height=1 src="vb9.files/666666.gif" vspace=1
width=420><BR>
<P align=center><B><FONT color=#000066><SPAN
class=sfont>VB5.0中实现字体闪烁效果</SPAN></FONT></B></P>
<P align=left><SPAN class=sfont> 用Visual
Basic我们可设计出形形色色符合用户要求的应用程序,它确实是一种很好的用户程序开发工具,可VB提供的基本控件中都没有闪烁属性设置,使应用程序界面缺乏“活性”,近期笔者设计软件封面时,就要求字体不断地闪烁,为此,经反复分析、实践,最后终于成功地实现字体闪烁效果,现将设计过程说明如下:<BR> (1)创建一个新目标文件(project1),并建立一个窗体Form1。<BR> (2)在Form1上配置一个计时器控制Timer1、标签控件Label1、命令控件Command1。<BR> (3)各控件属性设置:<BR> Timer1的Enabled设置为True;<BR> Label1的Caption设置为需闪烁的字体:“江西省黎川县职业中专电脑室设计”、<BR>Font设置字体及大小、Backstyle设置为“0-Transparent”;<BR> Command1中的Caption设置为“退出”。<BR> (4)程序代码清单:<BR> Option
Explicit<BR> Private Sub Form_
Load()<BR> Label1.Top=850 <BR> ′设置闪烁字体的显示位置<BR> Label1.Left=750<BR> Timer1.Interval=555 <BR> ′设置字体闪烁间隔时间<BR> Form1.Windowstate=2<BR> End
Sub<BR> ′利用计时器控件Timer有规律地改变字体颜色(Forecolor)<BR> Private Sub
Timer1_Timer()<BR> Chc Label1,1,4,8<BR> End
Sub<BR> ′Chc过程是循环地改变字体颜色(Forecolor)<BR> Sub Chc(Cont As Control,Color1
As Integer,Color2 As Integer,Color3 As Integer)<BR> If
Val(Cont.Tag)=Color1 Then<BR> Cont.Tag=Color2<BR> ElseIf
Val(Cont.Tag)=Color2 Then<BR> Cont.Tag=Color3<BR> ElseIf
Val(Cont.Tag)=Color3
Then<BR> Cont.Tag=Color1<BR> Else<BR> Cont.Tag=Color1<BR> End
If<BR> Cont.ForeColor=QBColor(Cont.Tag)<BR> End Sub<BR> Private Sub
Command1_Click()<BR> End<BR> End
Sub<BR> 程序除标签控件外,还适用于许多VB基本控件,实现诸多闪烁效果,例如:闪烁文本框、闪烁文件列表框等,极大丰富了VB应用程序界面,相当实用。<BR> 此设计也适用VB3.0、VB4.0。 <STRONG>(江西 范明之)</STRONG></SPAN></P>
<P align=right><A
href="http://www.pconline.com.cn/experience/subject/VB/index.html">----更多的文章</A></P><!-- #EndEditable --></TD></TR></TBODY></TABLE>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=760>
<TBODY>
<TR>
<TD bgColor=#666666 width=1><IMG height=1 src="vb9.files/blank.gif"
width=1></TD>
<TD align=right vAlign=bottom width=170><IMG height=10
src="vb9.files/blank.gif" width=170><BR></TD>
<TD bgColor=#666666 width=1><IMG height=1 src="vb9.files/blank.gif"
width=1></TD>
<TD width=21><IMG height=1 src="vb9.files/blank.gif" width=21></TD>
<TD bgColor=#eeeeee width=566><IMG height=10 src="vb9.files/blank.gif"
width=566><BR>版权所有©1999 太平洋电脑信息网<BR><FONT
face="Arial, Helvetica, sans-serif"><A
href="mailto:exp@pconline.com.cn">exp@pconline.com.cn</A></FONT> <IMG
height=1 src="vb9.files/hhvisit.html" width=1> </TD></TR></TBODY></TABLE><!-- #EndTemplate --></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -