Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. mousehover?

mousehover?

Scheduled Pinned Locked Moved Visual Basic
csharpvisual-studiohelptutorial
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nadroj
    wrote on last edited by
    #1

    im very new to vs.net windows apps. i know the console apps quite a bit now. i am also coming from vb6. i was just wondering how to perform code when events such as mousehover occurs? or any of these basic events. any help appreciated, thanks. ------------------------ Jordan. III

    M 1 Reply Last reply
    0
    • N Nadroj

      im very new to vs.net windows apps. i know the console apps quite a bit now. i am also coming from vb6. i was just wondering how to perform code when events such as mousehover occurs? or any of these basic events. any help appreciated, thanks. ------------------------ Jordan. III

      M Offline
      M Offline
      Matthew Hazlett
      wrote on last edited by
      #2

      If you are using the VS.NET IDE then in the code view there are two dropdowns. Set the first dropdown to the object you want to set the event for and set the second dropdown to the event you want to hook into. It will generate the Subs for you, you just fill in the details. -OR- If you are not using the IDE then you can use addHandler to hook into the events. ex. addhandler Panel1.Click, addressof clickResponse (addrssof sets clickResponse as the callback sub) the advantage to doing this is you can do somthing like addhandler Panel1.Click, addressof clickResponse addhandler Panel2.Click, addressof clickResponse addhandler Panel3.Click, addressof clickResponse and in clickResponse just do a sender.name to get the object that called the sub -or (the easiest way) - You can declare it like this: Private Sub Panel1_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Panel1.Click The handles on the end specifies whats tied to this sub you can also specify multiple events this way like so: Private Sub Panel1_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Panel1.Click, Panel2.Click, Panel3.Click as you can see the name of the sub is not important using this method it could be anything you want like.. Private Sub eatAtJoes(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Panel1.Click, Panel2.Click, Panel3.Click

      N 1 Reply Last reply
      0
      • M Matthew Hazlett

        If you are using the VS.NET IDE then in the code view there are two dropdowns. Set the first dropdown to the object you want to set the event for and set the second dropdown to the event you want to hook into. It will generate the Subs for you, you just fill in the details. -OR- If you are not using the IDE then you can use addHandler to hook into the events. ex. addhandler Panel1.Click, addressof clickResponse (addrssof sets clickResponse as the callback sub) the advantage to doing this is you can do somthing like addhandler Panel1.Click, addressof clickResponse addhandler Panel2.Click, addressof clickResponse addhandler Panel3.Click, addressof clickResponse and in clickResponse just do a sender.name to get the object that called the sub -or (the easiest way) - You can declare it like this: Private Sub Panel1_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Panel1.Click The handles on the end specifies whats tied to this sub you can also specify multiple events this way like so: Private Sub Panel1_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Panel1.Click, Panel2.Click, Panel3.Click as you can see the name of the sub is not important using this method it could be anything you want like.. Private Sub eatAtJoes(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Panel1.Click, Panel2.Click, Panel3.Click

        N Offline
        N Offline
        Nadroj
        wrote on last edited by
        #3

        first of all, thank you. and i do like that last easy method.. only one problem, i was just messing around with the events for a button. im using system.eventargs to handle the click event, and forms.mouseeventargs to handle mousemove. is there a page to go to that gives a list of all the references you must use in order to do each event? like, say i want to do an event for a button which controls the mousedown method. is there a way of determining what you need to set 'e' as? ------------------------ Jordan. III

        M 1 Reply Last reply
        0
        • N Nadroj

          first of all, thank you. and i do like that last easy method.. only one problem, i was just messing around with the events for a button. im using system.eventargs to handle the click event, and forms.mouseeventargs to handle mousemove. is there a page to go to that gives a list of all the references you must use in order to do each event? like, say i want to do an event for a button which controls the mousedown method. is there a way of determining what you need to set 'e' as? ------------------------ Jordan. III

          M Offline
          M Offline
          Matthew Hazlett
          wrote on last edited by
          #4

          You do not set "e". Anything like mouseevent args are paramiters to he sub. In otherwords thats what gets sent to the sub. in the case of MouseEventArgs you can check things like if e.button = mousebutton.left etc... Read all about it in the help or on MSDN and download apps that people write so you can see how things are done. Start here: http://samples.gotdotnet.com/quickstart/winforms/[^] Msdn: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpqstart/html/cpsmpwindowsformsquickstart.asp[^]

          N 1 Reply Last reply
          0
          • M Matthew Hazlett

            You do not set "e". Anything like mouseevent args are paramiters to he sub. In otherwords thats what gets sent to the sub. in the case of MouseEventArgs you can check things like if e.button = mousebutton.left etc... Read all about it in the help or on MSDN and download apps that people write so you can see how things are done. Start here: http://samples.gotdotnet.com/quickstart/winforms/[^] Msdn: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpqstart/html/cpsmpwindowsformsquickstart.asp[^]

            N Offline
            N Offline
            Nadroj
            wrote on last edited by
            #5

            about the 'e' thing, i was referring to the 'ByVal e As System.EventArgs' part. i guess i shouldntve said what do you set e to, but what type, or event, or wutever its called, do you set e to. but thank you. I will go check out the docs now, thx again for ur help. ------------------------ Jordan. III

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups