2 Replies - 442 Views - Last Post: 17 June 2021 - 12:38 PM Rate Topic: -----

#1 Hardings   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-June 21

Vb.net using mouseenter event with tags

Posted 17 June 2021 - 12:06 PM

In one of my forms I have over 10 buttons. I would like to give each button a tag such as "CursorChange". I am trying to change the cursor to cursors.hand on button1.MouseEnter. I know that I can create separate handles for each mouse enter event but I would rather not create a handle for every button that I would like to do this with, as I would implement this with other forms too.
Is This A Good Question/Topic? 0
  • +

Replies To: Vb.net using mouseenter event with tags

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 16302
  • View blog
  • Posts: 64,852
  • Joined: 12-June 08

Re: Vb.net using mouseenter event with tags

Posted 17 June 2021 - 12:19 PM

You should look at creating a custom control that extends the button class. Inside of there do what ever need to do for cursor changing.

Then swap all your existing buttons out for that new class.

Aught to work.
Was This Post Helpful? 1
  • +
  • -

#3 Hardings   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-June 21

Re: Vb.net using mouseenter event with tags

Posted 17 June 2021 - 12:38 PM

Thank you, while I was looking into creating custom controls, I noticed that in the properties list is Cursor, where you are able to choose exactly what I was trying to do during runtime
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1