Calling mousehover event for dynamic button control?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marc

    #1

    Calling mousehover event for dynamic button control?

    Hi,

    I create buttons dynamically at runtime in my application. I want to
    open a messgae box when the user hovers over a button.how can i do
    this?

    i need something like the below(which doesnt work!)

    Private Sub test (ByVal sender As System.Object, ByVal e As
    System.EventArg s)Handles me.activecontro l.mousehover
    msbox("test")
    end sub

    Thanks

  • rowe_newsgroups

    #2
    Re: Calling mousehover event for dynamic button control?

    On Mar 1, 11:07 am, "Marc" <marc_cro...@ho tmail.comwrote:
    Hi,
    >
    I create buttons dynamically at runtime in my application. I want to
    open a messgae box when the user hovers over a button.how can i do
    this?
    >
    i need something like the below(which doesnt work!)
    >
    Private Sub test (ByVal sender As System.Object, ByVal e As
    System.EventArg s)Handles me.activecontro l.mousehover
    msbox("test")
    end sub
    >
    Thanks
    For dynamic created controls you need to map the event(s) dynamically
    too.

    i.e.

    private sub AddButton()
    Dim b as new button()
    AddHandler b.MouseHover, AddressOf test
    end sub

    private sub test(sender as object, e as eventargs)
    msgbox("test")
    end sub

    Thanks,

    Seth Rowe

    Comment

    • Marc

      #3
      Re: Calling mousehover event for dynamic button control?

      On 1 Mar, 16:24, "rowe_newsgroup s" <rowe_em...@yah oo.comwrote:
      On Mar 1, 11:07 am, "Marc" <marc_cro...@ho tmail.comwrote:
      >
      Hi,
      >
      I create buttons dynamically at runtime in my application. I want to
      open a messgae box when the user hovers over a button.how can i do
      this?
      >
      i need something like the below(which doesnt work!)
      >
      Private Sub test (ByVal sender As System.Object, ByVal e As
      System.EventArg s)Handles me.activecontro l.mousehover
      msbox("test")
      end sub
      >
      Thanks
      >
      For dynamic created controls you need to map the event(s) dynamically
      too.
      >
      i.e.
      >
      private sub AddButton()
      Dim b as new button()
      AddHandler b.MouseHover, AddressOf test
      end sub
      >
      private sub test(sender as object, e as eventargs)
      msgbox("test")
      end sub
      >
      Thanks,
      >
      Seth Rowe
      great thanks

      Comment

      • Marc

        #4
        Re: Calling mousehover event for dynamic button control?

        On 1 Mar, 16:24, "rowe_newsgroup s" <rowe_em...@yah oo.comwrote:
        On Mar 1, 11:07 am, "Marc" <marc_cro...@ho tmail.comwrote:
        >
        Hi,
        >
        I create buttons dynamically at runtime in my application. I want to
        open a messgae box when the user hovers over a button.how can i do
        this?
        >
        i need something like the below(which doesnt work!)
        >
        Private Sub test (ByVal sender As System.Object, ByVal e As
        System.EventArg s)Handles me.activecontro l.mousehover
        msbox("test")
        end sub
        >
        Thanks
        >
        For dynamic created controls you need to map the event(s) dynamically
        too.
        >
        i.e.
        >
        private sub AddButton()
        Dim b as new button()
        AddHandler b.MouseHover, AddressOf test
        end sub
        >
        private sub test(sender as object, e as eventargs)
        msgbox("test")
        end sub
        >
        Thanks,
        >
        Seth Rowe
        great thanks

        Comment

        Working...