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. TreeView Hit-Testing issue...

TreeView Hit-Testing issue...

Scheduled Pinned Locked Moved WPF
questiondata-structurestestingbeta-testinghelp
1 Posts 1 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.
  • S Offline
    S Offline
    SledgeHammer01
    wrote on last edited by
    #1

    Trying to do some hit-testing in a TreeView. This control is *such* a pita to deal with. Say the tree is: 1 -2 -3 -4 I want to band items 2 through 4. So I'm trying to figure out which items are in the banding rectangle. Of course, any collapsed branches, the items inside those branches should be ignored. The tree above is a simple example, but I also need to be able to band items with different parents, etc. So anyways, my first idea was to create a rectangle for item2 and one for item4. Transform relative to the TreeView and do a hit-test on the rectangle. However, the hit-test returns: 1 4 3 2 The 4,3,2 is what I want obviously, but it included that darn 1 (the parent node). I understand that technically 2,3,4 are inside of 1, but the visual aspect of 1 is obviously not overlapping with 2,3,4. How can I only get 2,3,4? The issue is of course recursive, so if I have a tree: 1 -2 --3 ---a ---b --4 and band a -> b, I get 1, 2, 3, b, a...

    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