首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

麻烦高手帮小弟我看看这段代码

2012-04-17 
麻烦高手帮我看看这段代码VB codePrivate Sub Form_Load()Me.Left (Screen.Width - Me.Left) / 2Me.Top

麻烦高手帮我看看这段代码

VB code
Private Sub Form_Load()Me.Left = (Screen.Width - Me.Left) / 2Me.Top = (Screen.Height - Me.Height) / 2End SubPrivate Sub Timer1_Timer()If Label1.Left < Me.Width ThenLabel1.Left = Label1.Left + 100ElseIf Label1.Left > -Me.Width ThenLabel1.Left = -Label1.WidthEnd IfIf Label1.ForeColor = &HFF0000 ThenLabel1.ForeColor = &HFF&ElseLabel1.ForeColor = &HFF0000End IfEnd Sub
如何让文字相左移动并且循环呢

[解决办法]
VB code
Option ExplicitDim strA() As StringDim intStart As IntegerPrivate Sub Form_Load()    strA() = Split("热,烈,欢,迎,x,y,z,参,观", ",")    Timer1.Interval = 1000End SubPrivate Sub Timer1_Timer()    Dim intP As Integer    Dim strP As String    For intP = intStart To UBound(strA)        strP = strP & strA(intP)    Next intP    For intP = 0 To intStart        strP = strP & strA(intP)    Next intP    Label1.Caption = strP    intStart = (intStart + 1) Mod (UBound(strA) - LBound(strA) + 1)End Sub 

热点排行