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. WPF
  4. mouse click

mouse click

Scheduled Pinned Locked Moved WPF
question
6 Posts 3 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.
  • M Offline
    M Offline
    michaelgr1
    wrote on last edited by
    #1

    Hello, I have a button which opens a popup. I want the option - if user clicks in any place outside of this button or popup so it will be closed. otherwise it will be on screen. How can i do it?

    A 1 Reply Last reply
    0
    • M michaelgr1

      Hello, I have a button which opens a popup. I want the option - if user clicks in any place outside of this button or popup so it will be closed. otherwise it will be on screen. How can i do it?

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      Try to grab focus and then when when the click event does not occur on the popup, close the popup. To get the click event and check if the mouse pointer is not within the popup frame, use GetVisualDescendants .

      M 1 Reply Last reply
      0
      • A Abhinav S

        Try to grab focus and then when when the click event does not occur on the popup, close the popup. To get the click event and check if the mouse pointer is not within the popup frame, use GetVisualDescendants .

        M Offline
        M Offline
        michaelgr1
        wrote on last edited by
        #3

        how to use this GetVisualDescendants ?

        P A 2 Replies Last reply
        0
        • M michaelgr1

          how to use this GetVisualDescendants ?

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          In code.

          *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

          "Mind bleach! Send me mind bleach!" - Nagy Vilmos

          My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

          M 1 Reply Last reply
          0
          • P Pete OHanlon

            In code.

            *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

            "Mind bleach! Send me mind bleach!" - Nagy Vilmos

            My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

            M Offline
            M Offline
            michaelgr1
            wrote on last edited by
            #5

            can you give an example?

            1 Reply Last reply
            0
            • M michaelgr1

              how to use this GetVisualDescendants ?

              A Offline
              A Offline
              Abhinav S
              wrote on last edited by
              #6

              Have a look here[^] for an example.

              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