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. get control name in a canvas

get control name in a canvas

Scheduled Pinned Locked Moved WPF
questionlearning
3 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.
  • C Offline
    C Offline
    ctlqt12
    wrote on last edited by
    #1

    Hi all, I have a canvas ( naming cn ) with MouseButtonDown event, i also have three textblocks in it. When i press a textblock in canvas, the event is raised with the sender is canvas ( of course ). How could i get the name of clicked-textblock ?

    A 1 Reply Last reply
    0
    • C ctlqt12

      Hi all, I have a canvas ( naming cn ) with MouseButtonDown event, i also have three textblocks in it. When i press a textblock in canvas, the event is raised with the sender is canvas ( of course ). How could i get the name of clicked-textblock ?

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

      Check out the original source property of the event and see if it contains that text block. For more information, see here[^].

      C 1 Reply Last reply
      0
      • A Abhinav S

        Check out the original source property of the event and see if it contains that text block. For more information, see here[^].

        C Offline
        C Offline
        ctlqt12
        wrote on last edited by
        #3

        I solve it. Thank you for your support !

        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