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.
User avatar
JohnTitor
Posts: 153
Joined: Fri Nov 17, 2017 8:49 pm

Re: List all WebColors in a drop down

Post by JohnTitor » Fri Apr 05, 2019 7:55 am

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 19 times

User avatar
jvierra
Posts: 13687
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: List all WebColors in a drop down

Post by jvierra » Fri Apr 05, 2019 8:17 am

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
JohnTitor
Posts: 153
Joined: Fri Nov 17, 2017 8:49 pm

Re: List all WebColors in a drop down

Post by JohnTitor » Fri Apr 05, 2019 8:21 am

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
Joined: Thu Aug 18, 2011 4:56 am

Re: List all WebColors in a drop down

Post by davidc » Thu Jun 13, 2019 10:01 am

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.

Locked