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. HitTest Problem

HitTest Problem

Scheduled Pinned Locked Moved WPF
helpcsharpdatabaselinqtutorial
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.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    I am creating an app that will replace the Linq-To-SQL designer. Most of the code you see is from other apps I found on CP or other places all pieced together. My app is here[^]. So far there's not much there. If you run it you will see a mock table on the designer surface. It can be moved around. There is Select checkbox in the upper left corner of the main window. Checking it turns on the table's adorners for sizing. Problem: What I want to do is turn on the sizing adorners on the table when the table's header or footer area is clicked. But because both the header & footer border controls have their IsHitTestVisible set to False, the MouseDown even doesn't fire. I'm not really sure how to make this work. I could use some help. Many thanks!

    If it's not broken, fix it until it is

    J 1 Reply Last reply
    0
    • K Kevin Marois

      I am creating an app that will replace the Linq-To-SQL designer. Most of the code you see is from other apps I found on CP or other places all pieced together. My app is here[^]. So far there's not much there. If you run it you will see a mock table on the designer surface. It can be moved around. There is Select checkbox in the upper left corner of the main window. Checking it turns on the table's adorners for sizing. Problem: What I want to do is turn on the sizing adorners on the table when the table's header or footer area is clicked. But because both the header & footer border controls have their IsHitTestVisible set to False, the MouseDown even doesn't fire. I'm not really sure how to make this work. I could use some help. Many thanks!

      If it's not broken, fix it until it is

      J Offline
      J Offline
      Jason Gleim
      wrote on last edited by
      #2

      I'm not sure the hit test is the problem. I didn't dive in really deep but when you move your mouse over the table, the cursor switches to the cross to indicate moving the table. However, you have to click to move the table. I'm guessing that clicking on the header of the table is actually activating the table move logic... meaning the "move" action is swallowing the click on the header you want. I suggest moving that table move functionality down. If you want to click on the header and show the size adorners then move the cross/table move functionality down in the visual tree. Or switch to a double-click to show the size adorners. (That would seem more "normal" to me anyway) HTH!

      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