Change cursor style while in a class?

  • Thread starter Thread starter Alex Cote
  • Start date Start date
A

Alex Cote

Guest
Hi,

in my project I have a class that Inherit TabPage and that build a TabPage with a bunch of controls on it (DatagridView, button, etc...). So that way I can easily add new TapPage, with all the controls, to my TabControl.

In that class the button is assign an action on click, doing a query on a SQL database, and I am trying to switch the cursor to Cursors.WaitCursor while the search is perform.

I have tried, in the class :

Private Sub btn_Search_Click(sender As Object, e As EventArgs) Handles btn_Search.Click
Me.Cursor = Cursors.WaitCursor
DoTheSearch() 'This is a "Private Sub" in the class
Me.Cursor = Cursors.Default
End Sub
also this

Private Sub btn_Search_Click(sender As Object, e As EventArgs) Handles btn_Search.Click
Form.ActiveForm.Cursor = Cursors.WaitCursor
DoTheSearch() 'This is a "Private Sub" in the class
Form.ActiveForm.Cursor = Cursors.Default
End Sub

None works.

Anyone knows how to do this?

Continue reading...
 
Back
Top