VB闪动控件名

来源:百度知道 编辑:UC知道 时间:2024/06/01 04:58:55
控件:一个窗体,一个输入文本框
设置:给窗体和文本框加上名称,名称可随便
要求:运行,窗体上的名称和文本框内的内容会循环移动
提示:谢绝开网站索取答案

Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub

Private Sub Timer1_Timer()
Text1.Text = Mid(Text1.Text, 2, Len(Text1.Text) - 1) & Left(Text1.Text, 1)
Me.Caption = Mid(Me.Caption, 2, Len(Me.Caption) - 1) & Left(Me.Caption, 1)
End Sub

Private Sub Form_Load()
Timer1.Interval = 1000
Form1.Caption = "窗体名"
Text1.Text = "文本名"
End Sub

Private Sub Timer1_Timer()
If Form1.Caption = "窗体名" And Text1.Text = "文本名" Then
Form1.Caption = "文本名": Text1.Text = "窗体名"
ElseIf Form1.Caption = "文本名" And Text1.Text = "窗体名" Then
Form1.Caption = "窗体名": Text1.Text = "文本名"
End If
End Sub