跑马灯(VB6代码)

news/2024/11/24 18:29:10/
Option Explicit
'直接F5:)
Private Const lDir As Long = -1                   '方向,+1与-1分别为右转与左转
Dim WithEvents Timer1 As TimerPrivate Sub Form_Load()'用代码添加控件并设置控件的初始状态.
'这样方便点,可以直接粘贴+F5:)With Me.Controls.Add "VB.Label", "Label1".Add "VB.Label", "Label2".Add "VB.PictureBox", "Picture1".Add "VB.Timer", "Timer2"Set Timer1 = Me!Timer2End WithWith Me!Label1.AutoSize = True.Caption = "<-- 测试测试!@$)(#*%#^*$#@! -->".Visible = TrueMe!Label2.Visible = TrueEnd WithWith Me!Picture1.Appearance = 0                           'Flat.Move 1000, 1000, Me!Label1.Width, Me!Label1.Height + 30.Visible = TrueEnd WithWith Me!Label1Set .Container = Me!Picture1Set Me!Label2.Container = Me!Picture1.Move 0, 0Me!Label2.Move .Width, 0, .Width, .HeightMe!Label2.Caption = .CaptionEnd WithTimer1.Interval = 50Timer1.Enabled = True
End SubPrivate Sub Timer1_Timer()Static oLab1 As Label, oLab2 As LabelDim oTmp As LabelIf oLab1 Is Nothing Then Set oLab1 = Me!Label1If oLab2 Is Nothing Then Set oLab2 = Me!Label2If lDir > 0 ThenIf oLab1.Left > oLab1.Width ThenSet oTmp = oLab1Set oLab1 = oLab2Set oLab2 = oTmpEnd IfElseIf oLab1.Left <= -oLab1.Width ThenSet oTmp = oLab1Set oLab1 = oLab2Set oLab2 = oTmpEnd IfEnd IfWith oLab1.Move .Left + 15 * lDiroLab2.Move .Left + .Width * (-lDir)Me.Caption = .Left & "," & oLab2.LeftEnd WithDoEvents
End Sub

转载于:https://www.cnblogs.com/any-time-any-place/archive/2012/11/08/2759832.html


http://www.ppmy.cn/news/848000.html

相关文章

文字跑马灯HTML代码解析

<table style"color:white; font-size:10pt" border"1" style"color:white; font-size:10pt" bordercolor"#FF9900"> <td background"图档网址.gif"> <p> <font color"#FFFF00" face"新…

跑马灯代码的解释

android:layopt_marginTop"10dp"(与上一行的间隔) android:singleine"true"(只能单行显示) 1、定义textView标签的4个属性&#xff1a; android:singleLine"true"//使其只能单行 android:ellipsize"marquee"//去掉省略号 android:foc…

51单片机跑马灯c语言,51单片机——跑马灯详解(示例代码)

#include #include intmain() { unsignedchar temp 0xFE;int num; //temp 转化为十进制数字 char j[20]; //二进制数字字符串 while(1){ numtemp; itoa(num,j,2); //十进制转二进制 itoa(待转,输出,进制) printf("%s\n",j); //输出转换后的二进制编码 temp (temp &…

寄存器跑马灯

之前看的库函数操作的LED灯&#xff0c;和平常调用读卡器无异。这次读下芯片文档&#xff0c;用空工程模板操作寄存器控制LED灯。 VID_20220322_205657 第一次接触寄存器操作&#xff0c;有点烧脑&#xff0c;烧脑过后感觉比库函数操作还清晰些。APB2ENR&#xff0c;CRL&#x…

代码 动态 设置 跑马灯

代码设置跑马灯&#xff0c;直接上代码 mTitleTv.setMarqueeRepeatLimit(Integer.MAX_VALUE);mTitleTv.setFocusable(true);mTitleTv.setEllipsize(TextUtils.TruncateAt.MARQUEE);mTitleTv.setSingleLine();mTitleTv.setFocusableInTouchMode(true);mTitleTv.setHorizontallyS…

跑马灯源代码

希望对小白有作用&#xff1a;首先献上资料&#xff1a; arqueeRepeatLimit属性是文字滚动起来http://xlover.iteye.com/blog/1443280 android:ellipsiz属性&#xff1a;省略文字http://www.ablanxue.com/prone_9786_1.html 自定义组件http://www.android100.org/html/201506/2…

html跑马灯走马灯效果

演示 <marquee width"100%" scrollamount"5"> <a href"http://www.taobaojp5.tk"><font face"楷体_GB2312" color"#ff0000" size"3"></font><strong>带有超链接的跑马灯!点我试试&…

html制作跑马灯

在body内输入以下内容 <marquee>输入内容 </marquee> 在head内写个style <style>marquee{width:200px;height:200px;bgcolor:red;} </style> 这样简单的跑马灯就出来了。 一下内容要添加在marquee标签内&#xff1a; 指定跑马灯的方向是向上的&am…