用VB编写一个文本框向左移的程序

2025-02-28 00:04:07
推荐回答(1个)
回答1:

窗体放置一个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