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. DragMove not working with MouseUp event

DragMove not working with MouseUp event

Scheduled Pinned Locked Moved WPF
csharpwpfhelpquestion
2 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.
  • A Offline
    A Offline
    amitairos
    wrote on last edited by
    #1

    Hi. I have a UserControl in WPF. The UserControl has a MouseLeftButtonUp event. The problem is- the Window has a this.DragMove() method in its MouseDown event which seems to interfere with the MouseLeftButtonUp event in the User Control (I need the this.DragMove() method to move the borderless window). If I call the dragmove method in the Window's MouseDown event, then if I click on the user control- the MouseLeftButtonUp event doesn't fire. But if I don't call the dragmove method- the MouseLeftButtonUp event works fine. Any ideas? Thanks!

    M 1 Reply Last reply
    0
    • A amitairos

      Hi. I have a UserControl in WPF. The UserControl has a MouseLeftButtonUp event. The problem is- the Window has a this.DragMove() method in its MouseDown event which seems to interfere with the MouseLeftButtonUp event in the User Control (I need the this.DragMove() method to move the borderless window). If I call the dragmove method in the Window's MouseDown event, then if I click on the user control- the MouseLeftButtonUp event doesn't fire. But if I don't call the dragmove method- the MouseLeftButtonUp event works fine. Any ideas? Thanks!

      M Offline
      M Offline
      Michael Eber
      wrote on last edited by
      #2

      Since the first days of windows event programming it has always been a heirarchy for event processing that the form first, container second, contained controls next, controls in a container in the contained controls last.... The only way you can get away from that is not going to be clean. On MouseEnter on your control, remove the DragMove event handler binding and put your mouse click event on. On MouseLeave on your control, remove the left button event handler and put DragMove back on.

      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