Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8127815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:39:49+00:00 2026-06-06T07:39:49+00:00

Once I use visualTreeHelper.getchild to find a child object, how would I get the

  • 0

Once I use visualTreeHelper.getchild to find a child object, how would I get the name of that object, or even other properties of the object like width or height?

i.e.

This doesnt work:

For i As Integer = 0 To VisualTreeHelper.GetChildrenCount(Can1) - 1
Dim ChildVisual As Visual = CType(VisualTreeHelper.GetChild(Can1, i), Visual)
Dim ChildName As DependencyProperty = childVisual.GetValue(Name)

It says value of type “Name” cannot be converted to a system.windows.dependencyProperty

Nor does this work (But at least it compiles):

For i As Integer = 0 To VisualTreeHelper.GetChildrenCount(Can1) - 1
Dim childVisual As Visual = CType(VisualTreeHelper.GetChild(Can1, i), Visual)

Dim GT1 As GeneralTransform = childVisual.TransformToAncestor(Can1)

Dim currentpoint As Point = GT1.Transform(New Point(0, 0))

x = currentpoint.X
y = currentpoint.Y

If I hover over childvisual, I can look at it’s properties and see that name has been set to a name of an image I have on the canvas(Can1).
But, X and Y are always 0.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:39:50+00:00Added an answer on June 6, 2026 at 7:39 am

    I found this finally on the net, and it seems to work great.

    Dim childVisual As Visual = CType(VisualTreeHelper.GetChild(Can1, i), Visual) 
    Dim ChildName As String = ChildVisual.GetValue(Control.NameProperty)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to verify that an Account Name is not already in use once
I would like to create env variables once to use elsewhere in my fabric
I would like to use an image for background in the canvas element provided
I'd like to define it once and use it anywhere.
I have a constant value that I only plan to use once in my
Does anyone know how to turn off iPhone's GPS programmatically? Once I use the
Simple question. Why use require_once to include classes that you use within a file?
I'm trying to use jquery to switch between three images once you click on
I want to use this jQuery gallery more than once on my page: http://workshop.rs/2010/07/create-image-gallery-in-4-lines-of-jquery/
Here I use two images. when i click once on the Sort_down.png image then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.