查看單個文章
舊 2009-05-26, 10:32 PM   #3 (permalink)
kppne0931
註冊會員
榮譽勳章
UID - 311122
在線等級: 級別:3 | 在線時長:30小時 | 升級還需:2小時級別:3 | 在線時長:30小時 | 升級還需:2小時級別:3 | 在線時長:30小時 | 升級還需:2小時
註冊日期: 2008-10-06
文章: 65
精華: 0
現金: 124 金幣
資產: 144 金幣
預設

引用:
作者: 劍痞憶秋年 查看文章
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 


感覺上...很複雜耶....不然大大你看一下我用的不知道要如何改...


Private Sub Command3_Click()
Dim pw As String
pw = "kenc77996"

If Text4.Text <> pw Then

Label15.Caption = "帳號或密碼錯誤!"
Else


pw = "ken33664"

If Text5.Text <> pw Then

Label15.Caption = "帳號或密碼錯誤!"
Else
Label15.Caption = "登入成功!感謝您使用本程式"
Frame1.Enabled = True
Frame2.Enabled = True
Check1.Enabled = True
Check2.Enabled = True
Check3.Enabled = True
Check4.Enabled = True
Check5.Enabled = True
Check6.Enabled = True
Check7.Enabled = True
Check8.Enabled = True
Check9.Enabled = True
Check10.Enabled = True
Check11.Enabled = True
Text1.Enabled = True
Text2.Enabled = True
Command1.Enabled = True
Command2.Enabled = True
End If
End If

End Sub


以上片段...按下Command出現連線中...一樣跑出句號...然後再檢測PW 如果正確 則顯示登入成功 如果錯誤 則顯示帳號或密碼錯誤 請問如果這樣要如何改...
kppne0931 目前離線  
送花文章: 77, 收花文章: 61 篇, 收花: 117 次
回覆時引用此帖
有 2 位會員向 kppne0931 送花:
Living (2009-05-27),magicwoo (2009-05-30)
感謝您發表一篇好文章