Form Control Type

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 9 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
boyddt_co
Posts: 89
Last visit: Mon Sep 25, 2023 9:36 pm

Form Control Type

Post by boyddt_co »

I need to enumerate the controls on a form and disable some based on a users selection. I can do the enumeration and the disabling but what I'm struggling with is getting the type of control that I'm working with. Can someone provide the code that I would use to pull what type of control I'm accessing?

Thanx in advance.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Form Control Type

Post by jvierra »

$anycontrol.GetType().Name
User avatar
boyddt_co
Posts: 89
Last visit: Mon Sep 25, 2023 9:36 pm

Re: Form Control Type

Post by boyddt_co »

Thank you, that helped.
This topic is 9 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked