List all WebColors in a drop down

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 4 years and 9 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
apowershelluser
Posts: 194
Last visit: Fri Mar 22, 2024 4:38 am
Answers: 2

Re: List all WebColors in a drop down

Post by apowershelluser »

Just curious why would you do this?

Is this just to show more properties and the correct enum?

This is working just fine for me, as of right now I'll only be worried about the BG of the form
Attachments
MainForm.psf
(37.59 KiB) Downloaded 118 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: List all WebColors in a drop down

Post by jvierra »

If you want the color objects then this retains the object and not just the name. Without the object it is not possible to tell what kind of color it is or where it can be used. If you think that the strings are all you need then don't worry about it but the need may arise and this is the solution. It also is a good simple demo of how to use a list control with a collection of objects.
User avatar
apowershelluser
Posts: 194
Last visit: Fri Mar 22, 2024 4:38 am
Answers: 2

Re: List all WebColors in a drop down

Post by apowershelluser »

It's extremely cool and I'm definitely keeping it for future use like I do with all your use..
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: List all WebColors in a drop down

Post by davidc »

FYI, we included a new control set to display colors in a combobox:

https://www.sapien.com/blog/2019/06/13/ ... of-colors/
David
SAPIEN Technologies, Inc.
This topic is 4 years and 9 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