![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | How to obtain the controls list of a window hi all i would obtain the controls list of a window (same as the this.Controls property of a winform) is there any method or property to do this ? thanks for your help ! -- Thierry |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: How to obtain the controls list of a window It's up to the control's implementor to provide access to its logical parent/children. However you can walk the visual tree by using the VisualTreeHelper class. There are static methods like GetParent, GetChild, GetChildrenCount, etc. on there. -- Bill Henning Actipro Software WPF Wizard Control - http://www.actiprosoftware.com/Produ...d/Default.aspx "Thierry" <newsgroup@delacroix62.fr> wrote in message news 6543AF1-0524-4D2F-A211-92B19031A147@microsoft.com...> hi all > > i would obtain the controls list of a window (same as the this.Controls > property of a winform) > > is there any method or property to do this ? > > thanks for your help ! > > > -- > Thierry |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: How to obtain the controls list of a window It's up to the control's implementor to provide access to its logical parent/children. However you can walk the visual tree by using the VisualTreeHelper class. There are static methods like GetParent, GetChild, GetChildrenCount, etc. on there. -- Bill Henning Actipro Software WPF Wizard Control - http://www.actiprosoftware.com/Produ...d/Default.aspx "Thierry" <newsgroup@delacroix62.fr> wrote in message news 6543AF1-0524-4D2F-A211-92B19031A147@microsoft.com...> hi all > > i would obtain the controls list of a window (same as the this.Controls > property of a winform) > > is there any method or property to do this ? > > thanks for your help ! > > > -- > Thierry |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: How to obtain the controls list of a window You can use control's VisualChildrenCount property and GetVisualChild method. These members are protected so you can use them only of you derive from some control. For other cases use VisualTreeHelper and LogicalTreeHelper classes. -- HTH Stoitcho Goutsev (100) "Bill Henning" <no_spam@hotmail.com> wrote in message news:OhkAWJ7PHHA.404@TK2MSFTNGP02.phx.gbl... > It's up to the control's implementor to provide access to its logical > parent/children. However you can walk the visual tree by using the > VisualTreeHelper class. There are static methods like GetParent, > GetChild, GetChildrenCount, etc. on there. > > -- > > Bill Henning > Actipro Software > > WPF Wizard Control - > http://www.actiprosoftware.com/Produ...d/Default.aspx > > > > "Thierry" <newsgroup@delacroix62.fr> wrote in message > news 6543AF1-0524-4D2F-A211-92B19031A147@microsoft.com...>> hi all >> >> i would obtain the controls list of a window (same as the this.Controls >> property of a winform) >> >> is there any method or property to do this ? >> >> thanks for your help ! >> >> >> -- >> Thierry > > |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: How to obtain the controls list of a window You can use control's VisualChildrenCount property and GetVisualChild method. These members are protected so you can use them only of you derive from some control. For other cases use VisualTreeHelper and LogicalTreeHelper classes. -- HTH Stoitcho Goutsev (100) "Bill Henning" <no_spam@hotmail.com> wrote in message news:OhkAWJ7PHHA.404@TK2MSFTNGP02.phx.gbl... > It's up to the control's implementor to provide access to its logical > parent/children. However you can walk the visual tree by using the > VisualTreeHelper class. There are static methods like GetParent, > GetChild, GetChildrenCount, etc. on there. > > -- > > Bill Henning > Actipro Software > > WPF Wizard Control - > http://www.actiprosoftware.com/Produ...d/Default.aspx > > > > "Thierry" <newsgroup@delacroix62.fr> wrote in message > news 6543AF1-0524-4D2F-A211-92B19031A147@microsoft.com...>> hi all >> >> i would obtain the controls list of a window (same as the this.Controls >> property of a winform) >> >> is there any method or property to do this ? >> >> thanks for your help ! >> >> >> -- >> Thierry > > |
My System Specs![]() |
| | #6 (permalink) |
| Guest | Re: How to obtain the controls list of a window hi thanks stoitcho and bill it works with LogicalTreeHelper but not with VisualTree in the window constructor foreach (object child in LogicalTreeHelper.GetChildren(this)) works but VisualTreeHelper.GetChildrenCount(this) always return 0 ! "Stoitcho Goutsev (100)" <100@100.com> a écrit dans le message de news:u3Pbs78PHHA.780@TK2MSFTNGP03.phx.gbl... > You can use control's VisualChildrenCount property and GetVisualChild > method. These members are protected so you can use them only of you derive > from some control. For other cases use VisualTreeHelper and > LogicalTreeHelper classes. > > > -- > HTH > Stoitcho Goutsev (100) > > "Bill Henning" <no_spam@hotmail.com> wrote in message > news:OhkAWJ7PHHA.404@TK2MSFTNGP02.phx.gbl... >> It's up to the control's implementor to provide access to its logical >> parent/children. However you can walk the visual tree by using the >> VisualTreeHelper class. There are static methods like GetParent, >> GetChild, GetChildrenCount, etc. on there. >> >> -- >> >> Bill Henning >> Actipro Software >> >> WPF Wizard Control - >> http://www.actiprosoftware.com/Produ...d/Default.aspx >> >> >> >> "Thierry" <newsgroup@delacroix62.fr> wrote in message >> news 6543AF1-0524-4D2F-A211-92B19031A147@microsoft.com...>>> hi all >>> >>> i would obtain the controls list of a window (same as the this.Controls >>> property of a winform) >>> >>> is there any method or property to do this ? >>> >>> thanks for your help ! >>> >>> >>> -- >>> Thierry >> >> > > |
My System Specs![]() |
| | #7 (permalink) |
| Guest | Re: How to obtain the controls list of a window hi thanks stoitcho and bill it works with LogicalTreeHelper but not with VisualTree in the window constructor foreach (object child in LogicalTreeHelper.GetChildren(this)) works but VisualTreeHelper.GetChildrenCount(this) always return 0 ! "Stoitcho Goutsev (100)" <100@100.com> a écrit dans le message de news:u3Pbs78PHHA.780@TK2MSFTNGP03.phx.gbl... > You can use control's VisualChildrenCount property and GetVisualChild > method. These members are protected so you can use them only of you derive > from some control. For other cases use VisualTreeHelper and > LogicalTreeHelper classes. > > > -- > HTH > Stoitcho Goutsev (100) > > "Bill Henning" <no_spam@hotmail.com> wrote in message > news:OhkAWJ7PHHA.404@TK2MSFTNGP02.phx.gbl... >> It's up to the control's implementor to provide access to its logical >> parent/children. However you can walk the visual tree by using the >> VisualTreeHelper class. There are static methods like GetParent, >> GetChild, GetChildrenCount, etc. on there. >> >> -- >> >> Bill Henning >> Actipro Software >> >> WPF Wizard Control - >> http://www.actiprosoftware.com/Produ...d/Default.aspx >> >> >> >> "Thierry" <newsgroup@delacroix62.fr> wrote in message >> news 6543AF1-0524-4D2F-A211-92B19031A147@microsoft.com...>>> hi all >>> >>> i would obtain the controls list of a window (same as the this.Controls >>> property of a winform) >>> >>> is there any method or property to do this ? >>> >>> thanks for your help ! >>> >>> >>> -- >>> Thierry >> >> > > |
My System Specs![]() |
| | #8 (permalink) |
| Guest | Re: How to obtain the controls list of a window It is possible that there is a logical tree, but the vsiual tree doesn't exist. What is the control you are playing with? If it is a control that you wrote make sure that you override and provide implementation for VisualChildrenCount and GetVisualChild members. These are the methods that the VisualTreeHelper uses to walk the visual tree. -- Stoitcho Goutsev (100) "Thierry" <newsgroup@delacroix62.fr> wrote in message news:1294C214-8329-464A-9F96-5118EAD8C8E0@microsoft.com... > hi thanks stoitcho and bill > > it works with LogicalTreeHelper but not with VisualTree > > in the window constructor > > foreach (object child in LogicalTreeHelper.GetChildren(this)) works > > but VisualTreeHelper.GetChildrenCount(this) always return 0 ! > > > > > "Stoitcho Goutsev (100)" <100@100.com> a écrit dans le message de > news:u3Pbs78PHHA.780@TK2MSFTNGP03.phx.gbl... >> You can use control's VisualChildrenCount property and GetVisualChild >> method. These members are protected so you can use them only of you >> derive from some control. For other cases use VisualTreeHelper and >> LogicalTreeHelper classes. >> >> >> -- >> HTH >> Stoitcho Goutsev (100) >> >> "Bill Henning" <no_spam@hotmail.com> wrote in message >> news:OhkAWJ7PHHA.404@TK2MSFTNGP02.phx.gbl... >>> It's up to the control's implementor to provide access to its logical >>> parent/children. However you can walk the visual tree by using the >>> VisualTreeHelper class. There are static methods like GetParent, >>> GetChild, GetChildrenCount, etc. on there. >>> >>> -- >>> >>> Bill Henning >>> Actipro Software >>> >>> WPF Wizard Control - >>> http://www.actiprosoftware.com/Produ...d/Default.aspx >>> >>> >>> >>> "Thierry" <newsgroup@delacroix62.fr> wrote in message >>> news 6543AF1-0524-4D2F-A211-92B19031A147@microsoft.com...>>>> hi all >>>> >>>> i would obtain the controls list of a window (same as the >>>> this.Controls property of a winform) >>>> >>>> is there any method or property to do this ? >>>> >>>> thanks for your help ! >>>> >>>> >>>> -- >>>> Thierry >>> >>> >> >> > |
My System Specs![]() |
| | #9 (permalink) |
| Guest | Re: How to obtain the controls list of a window It is possible that there is a logical tree, but the vsiual tree doesn't exist. What is the control you are playing with? If it is a control that you wrote make sure that you override and provide implementation for VisualChildrenCount and GetVisualChild members. These are the methods that the VisualTreeHelper uses to walk the visual tree. -- Stoitcho Goutsev (100) "Thierry" <newsgroup@delacroix62.fr> wrote in message news:1294C214-8329-464A-9F96-5118EAD8C8E0@microsoft.com... > hi thanks stoitcho and bill > > it works with LogicalTreeHelper but not with VisualTree > > in the window constructor > > foreach (object child in LogicalTreeHelper.GetChildren(this)) works > > but VisualTreeHelper.GetChildrenCount(this) always return 0 ! > > > > > "Stoitcho Goutsev (100)" <100@100.com> a écrit dans le message de > news:u3Pbs78PHHA.780@TK2MSFTNGP03.phx.gbl... >> You can use control's VisualChildrenCount property and GetVisualChild >> method. These members are protected so you can use them only of you >> derive from some control. For other cases use VisualTreeHelper and >> LogicalTreeHelper classes. >> >> >> -- >> HTH >> Stoitcho Goutsev (100) >> >> "Bill Henning" <no_spam@hotmail.com> wrote in message >> news:OhkAWJ7PHHA.404@TK2MSFTNGP02.phx.gbl... >>> It's up to the control's implementor to provide access to its logical >>> parent/children. However you can walk the visual tree by using the >>> VisualTreeHelper class. There are static methods like GetParent, >>> GetChild, GetChildrenCount, etc. on there. >>> >>> -- >>> >>> Bill Henning >>> Actipro Software >>> >>> WPF Wizard Control - >>> http://www.actiprosoftware.com/Produ...d/Default.aspx >>> >>> >>> >>> "Thierry" <newsgroup@delacroix62.fr> wrote in message >>> news 6543AF1-0524-4D2F-A211-92B19031A147@microsoft.com...>>>> hi all >>>> >>>> i would obtain the controls list of a window (same as the >>>> this.Controls property of a winform) >>>> >>>> is there any method or property to do this ? >>>> >>>> thanks for your help ! >>>> >>>> >>>> -- >>>> Thierry >>> >>> >> >> > |
My System Specs![]() |
| | #10 (permalink) |
| Guest | Re: How to obtain the controls list of a window hi in fact i want to obtain all the control with an existing binding to add validation rule, maxlenght, etc.. i'm storing the rules in a custm attribute of the property of the object the object is the datacontext and i bind the property to the control (textbox, slider, ect...) so in the window constructor i want to enumerate the controls of this window an detect if a binding exist and in this case if the binding property contains a custom attribute i want to apply validation rules etc.... "Stoitcho Goutsev (100)" <100@100.com> a écrit dans le message de news:%233$yUT$PHHA.3944@TK2MSFTNGP06.phx.gbl... > It is possible that there is a logical tree, but the vsiual tree doesn't > exist. > > What is the control you are playing with? If it is a control that you > wrote make sure that you override and provide implementation for > VisualChildrenCount and GetVisualChild members. These are the methods that > the VisualTreeHelper uses to walk the visual tree. > > > -- > Stoitcho Goutsev (100) > > "Thierry" <newsgroup@delacroix62.fr> wrote in message > news:1294C214-8329-464A-9F96-5118EAD8C8E0@microsoft.com... >> hi thanks stoitcho and bill >> >> it works with LogicalTreeHelper but not with VisualTree >> >> in the window constructor >> >> foreach (object child in LogicalTreeHelper.GetChildren(this)) works >> >> but VisualTreeHelper.GetChildrenCount(this) always return 0 ! >> >> >> >> >> "Stoitcho Goutsev (100)" <100@100.com> a écrit dans le message de >> news:u3Pbs78PHHA.780@TK2MSFTNGP03.phx.gbl... >>> You can use control's VisualChildrenCount property and GetVisualChild >>> method. These members are protected so you can use them only of you >>> derive from some control. For other cases use VisualTreeHelper and >>> LogicalTreeHelper classes. >>> >>> >>> -- >>> HTH >>> Stoitcho Goutsev (100) >>> >>> "Bill Henning" <no_spam@hotmail.com> wrote in message >>> news:OhkAWJ7PHHA.404@TK2MSFTNGP02.phx.gbl... >>>> It's up to the control's implementor to provide access to its logical >>>> parent/children. However you can walk the visual tree by using the >>>> VisualTreeHelper class. There are static methods like GetParent, >>>> GetChild, GetChildrenCount, etc. on there. >>>> >>>> -- >>>> >>>> Bill Henning >>>> Actipro Software >>>> >>>> WPF Wizard Control - >>>> http://www.actiprosoftware.com/Produ...d/Default.aspx >>>> >>>> >>>> >>>> "Thierry" <newsgroup@delacroix62.fr> wrote in message >>>> news 6543AF1-0524-4D2F-A211-92B19031A147@microsoft.com...>>>>> hi all >>>>> >>>>> i would obtain the controls list of a window (same as the >>>>> this.Controls property of a winform) >>>>> >>>>> is there any method or property to do this ? >>>>> >>>>> thanks for your help ! >>>>> >>>>> >>>>> -- >>>>> Thierry >>>> >>>> >>> >>> >> > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Contact List on WinMail main window | BMeltzer | Vista mail | 3 | 07-21-2008 01:52 PM |
| Identify the list of controls in an app | Madmax42 | PowerShell | 3 | 05-19-2008 03:42 PM |
| Get Process List from window Service | kalpesh | Vista General | 5 | 06-27-2007 09:36 AM |
| how to list controls present on the Winfx window | sam | Avalon | 4 | 06-02-2006 11:28 PM |