首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

為什麼Label3控件不能顯示已循環的圈數,该怎么解决

2012-01-07 
為什麼Label3控件不能顯示已循環的圈數源碼如下PrivateDeclareFunctionCDdoorLibwinmm.dll AliasmciSen

為什麼Label3控件不能顯示已循環的圈數
源碼如下
Private   Declare   Function   CDdoor   Lib   "winmm.dll "   Alias   "mciSendStringA "   _
(ByVal   lpstrCommand   As   String,   ByVal   lpstrReturnString   As   String,   ByVal   uReturnLength   As   Long,   ByVal   hwndCallback   As   Long)   As   Long
Private   Declare   Sub   Sleep   Lib   "kernel32 "   (ByVal   dwMilliseconds   As   Long)

Private   Sub   Command1_Click()
Call   CDdoor( "set   CDAudio   door   open ",   0,   0,   0)
End   Sub

Private   Sub   Command2_Click()
Call   CDdoor( "set   CDAudio   door   closed ",   0,   0,   0)
End   Sub

Private   Sub   Command3_Click()
Dim   i   As   Single,   x   As   Single
x   =   Text1.Text
For   i   =   1   To   x   Step   1
    Call   CDdoor( "set   CDAudio   door   open ",   0,   0,   0)
    Sleep   (1000)
    Call   CDdoor( "set   CDAudio   door   closed ",   0,   0,   0)
    Label3.Caption   =   i     //此處i值無法在label3控件上顯示
  Next
End   Sub

Private   Sub   Command4_Click()
Unload   Me
End   Sub

Private   Sub   Form_Load()
Dim   x   As   Integer,   y   As   Integer
x   =   (Screen.Width   -   Form1.Width)   /   2
y   =   (Screen.Height   -   Form1.Height)   /   2
Move   x,   y
End   Sub
Private   Sub   Timer1_Timer()

End   Sub

Private   Sub   Text1_KeyPress(KeyAscii   As   Integer)
If   KeyAscii   =   13   Then
  Command3_Click
ElseIf   KeyAscii   =   27   Then
  Text1.Text   =   " "
End   If
End   Sub


[解决办法]
系统BUSY

热点排行