窗体放置一个text1, 运行后点击窗体Private Sub Form_Click()Dim a As Integera = -20If Text1.Left <= 0 Then a = -aText1.Left = Text1.Left + aDo Until Text1.Left < 0 Or Text1.Left + Text1.Width > Me.WidthText1.Left = Text1.Left + aLoopEnd Sub