用VB编写一个文本框向左移的程序
展开全部
窗体放置一个text1, 运行后点击窗体
Private Sub Form_Click()
Dim a As Integer
a = -20
If Text1.Left <= 0 Then a = -a
Text1.Left = Text1.Left + a
Do Until Text1.Left < 0 Or Text1.Left + Text1.Width > Me.Width
Text1.Left = Text1.Left + a
Loop
End Sub
Private Sub Form_Click()
Dim a As Integer
a = -20
If Text1.Left <= 0 Then a = -a
Text1.Left = Text1.Left + a
Do Until Text1.Left < 0 Or Text1.Left + Text1.Width > Me.Width
Text1.Left = Text1.Left + a
Loop
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询