當ToolStripButton.click事件發生時,我無法更改光標。更改光標VB.NET
我有2個按鈕叫「Rechercher」。
編輯:只有按鈕正在工作。看來,ToolStripButton取消我的光標... THX的幫助
Public Class FenetrePrincipale
Private WithEvents _btnRechercher As New Windows.Forms.ToolStripButton("Rechercher")
Private WithEvents btnRechercherAccesBtn As New Button
Private Sub Rechercher(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _btnRechercher.Click, btnRechercherAccesBtn.Click
Try
Me.Cursor = Cursors.WaitCursor
'WAITING FOR THE CODE TO FINISH (2 sec)
Finally
Me.Cursor = Cursors.Default
End Try
End Sub
End Class
這不是唯一的區別。 AccessBtn在運行過程之前設置光標*。您的程序中是否有「DoEvents」呼叫? – LarsTech 2012-02-03 19:53:24
也許你應該在你的sub中試用MsgBox(「hello」)來測試事件處理程序(以測試你是否點擊某件事情時發生或不) – FeRtoll 2012-02-07 15:02:59