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. Mouse Move on Label

Mouse Move on Label

Scheduled Pinned Locked Moved Visual Basic
help
6 Posts 4 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.
  • T Offline
    T Offline
    Tufail Ahmad
    wrote on last edited by
    #1

    I have two label1 and label2 on form by default label2.visible=False. when mouse move on label1 then label2.visible=True, else if mouse is not on label1(or over any other control) then label2.visible=False what should i do to set visibility of label2 to False if mouse is not over label1, help please

    D 1 Reply Last reply
    0
    • T Tufail Ahmad

      I have two label1 and label2 on form by default label2.visible=False. when mouse move on label1 then label2.visible=True, else if mouse is not on label1(or over any other control) then label2.visible=False what should i do to set visibility of label2 to False if mouse is not over label1, help please

      D Offline
      D Offline
      DaveAuld
      wrote on last edited by
      #2

      You can use the MouseEnter and MouseLeave events of Label1 and set Label2.Visible = False / True as appropriate.

      Dave GoogleWave: dave.m.auld[at]googlewave.com Who am I?: Web|Facebook|Twitter|LinkedIn|Bebo

      T 1 Reply Last reply
      0
      • D DaveAuld

        You can use the MouseEnter and MouseLeave events of Label1 and set Label2.Visible = False / True as appropriate.

        Dave GoogleWave: dave.m.auld[at]googlewave.com Who am I?: Web|Facebook|Twitter|LinkedIn|Bebo

        T Offline
        T Offline
        Tufail Ahmad
        wrote on last edited by
        #3

        there isn't any MouseEntry or MouseLeave events with label1 or 2. i am using vb6

        D D L 3 Replies Last reply
        0
        • T Tufail Ahmad

          there isn't any MouseEntry or MouseLeave events with label1 or 2. i am using vb6

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You should have mentioned you were using VB6 in your original post. If you don't, everyone assumes you're using VB.NET. There is no equivilent event in VB6. The closeest you're going to get is MouseMove, but you cannot tell if the mouse has left the label control, only when the mouse is moving on the label control.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008
          But no longer in 2009...

          1 Reply Last reply
          0
          • T Tufail Ahmad

            there isn't any MouseEntry or MouseLeave events with label1 or 2. i am using vb6

            D Offline
            D Offline
            DaveAuld
            wrote on last edited by
            #5

            Well I didn't know that did I! I don't have VB6 on any of my machines here at the moment, so can't look, but does the form have a MouseMove event? if so, you could use this in some way.

            Dave GoogleWave: dave.m.auld[at]googlewave.com Who am I?: Web|Facebook|Twitter|LinkedIn|Bebo

            1 Reply Last reply
            0
            • T Tufail Ahmad

              there isn't any MouseEntry or MouseLeave events with label1 or 2. i am using vb6

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Tufail Ahmad wrote:

              there isn't any MouseEntry or MouseLeave events with label1 or 2.

              There's a MouseMove that get's triggered when the mouse moves over the label - you could abuse that to simulate the events. Add a boolean value, and set it to "true" the first time that the MouseMove event fires. That would be the equivalent of a MouseEnter event. Clear the boolean again when there's a MouseMove on the main form, or if you didn't receive a MouseMove in the last two seconds; that's your MouseLeave event :)

              I are Troll :suss:

              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