MSGBOX 可能無法達到你要的,因為要按一下才會再換下一個新的訊息(無法直接 控制/改變 訊息內容)
所以咧,我就用表單 + TIMER 來試做你要的,不過看不到最後的 連線成功
試看看如何
PHP 語法:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '系統預設值
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 1440
TabIndex = 0
Top = 1200
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
With Form2
'清空計數器
.Times = 0
.Show
End With
End Sub
PHP 語法:
VERSION 5.00
Begin VB.Form Form2
Caption = "Form2"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form2"
LockControls = -1 'True
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '系統預設值
Begin VB.Timer Timer1
Interval = 500
Left = 3360
Top = 2160
End
Begin VB.Label Label1
Caption = "Label1"
Height = 495
Left = 600
TabIndex = 0
Tag = "連線中。"
Top = 960
Width = 1215
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private intTimes As Integer
Private Sub Form_Initialize()
intTimes = 0
Label1.Caption = Label1.Tag
End Sub
Public Property Get Times() As Integer
Times = intTimes
End Property
Public Property Let Times(ByVal vNewValue As Integer)
intTimes = vNewValue
End Property
Private Sub Form_Load()
Label1.Caption = Label1.Tag
End Sub
Private Sub Timer1_Timer()
'
If intTimes = 2 Then
Label1.Caption = "連線成功"
Unload Me
End If
Label1.Caption = Label1.Caption & "。"
intTimes = intTimes + 1
End Sub