Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8012221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:15:49+00:00 2026-06-04T19:15:49+00:00

I have a MouseEnter event which currently handles some custom controls on my form.

  • 0

I have a MouseEnter event which currently handles some custom controls on my form. The program is a card game. I have a collection (handCards) that gets populated when the user draws a card and then it adds the latest card to the form. This collection holds cards of various custom types, all which inherit from picturebox. Drawing the cards from the deck and adding them to the form works fine. The trouble I am having is that at runtime, after a card is drawn and added to the form, I’ve created an addhandler line of code to have those cards respond to my MouseEnter event, but my addhandler line of code is telling me that MouseEnter is not an event of object. How can I get around this so that after a card is drawn and added to the form, when the mouse enters the new custom control, my MouseEnter event fires? Here’s one of the many things I’ve tried and what I think should be the simplest and easiest that should work.

deck.DrawCard()
AddHandler handCards(handCards.Count).MouseEnter, AddressOf Cards_MouseEnter

P.S. the MouseEnter event works fine for custom controls that are on the form prior to runtime and all it does is take the image of the control and enlarge it by placing the image to a bigger card on the form.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:15:51+00:00Added an answer on June 4, 2026 at 7:15 pm

    So this is how I fixed it, in case anyone comes across this post. Made a separate Sub to do the AddHandler. After the program draws a card, it calls upon this method, which then adds the MouseEnter handler I need. The ByVal was key. I originally thought I was supposed to use ByRef, but no. MouseEnter is an event of control, but apparently not Object, so now it works.

    Public Sub addHandlers(ByVal inputObject As Control)
        AddHandler inputObject.MouseEnter, AddressOf Cards_MouseEnter
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a jQuery.event listener, which once triggers will display an otherwise hidden
I have a popup in a custom control that popups with a mouseenter event.
Currently I have a JQuery script in place http://jsfiddle.net/gaby/zzj7E/5/ which handles the requirement that
I currently have some dropdown menus which open on mouse over. I'm implementing some
I have a deferred function that binds a mouseenter event: $(window).load(function(e) { var $container
I have list of images with some simple mouseenter / mouseleave effect. http://jsfiddle.net/4vTCr/ I
I have create the class HoverButton which derives from Form.Button. Here I override the
I have an absolutely positioned div on which I am trying to trigger mouseenter
Currently I have the below jQuery which uses the colorbox plugin http://colorpowered.com/colorbox/ $(document).ready(function(){ $(.altbgcolor).hover(function()
At the site I'm developing , I have some div s which are loaded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.