User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

The PowerShell Studio v5.6.164 service build introduces a new ComboBox control set:

ComboBox – Colors

This control is useful when you need to provide the user with a color choice.


ComboBox Colors control set

When you select the ComboBox – Colors control set, PowerShell Studio inserts a ComboBox that displays a list of colors:

Colors ComboBox

Each item represents a System.Drawing.Color type and includes a preview of the color. When a user selects a color from the pull down, the ComboBox's SelectedItem property will contains the selected Color object:

	#Get the selected color
	$color = $comboboxColors.SelectedItem
	if ($color)
		#Apply the color to the RichTextBox
		$richtextbox1.SelectionColor = $color
		$richtextbox1.AppendText("Selected: $color `r`n")

In this example, the color name is displayed in the RichTextBox using the selected color:

Color Changed

Note: This control set was inspired by a user's post on our PowerShell GUIs forum. Please let us know what you think.

Related Articles:

Spotlight on the ComboBox

Wondering why my form is black? Refer to this article:

PowerShell Studio: I see a gray form and I want it painted black!

If you have questions about our products, please post in our support forum.
For licensed customers, use the forum associated with your product in our Product Support Forums for Registered Customers.
For users of trial versions, please post in our Former and Future Customers - Questions forum.
Copyright © 2024 SAPIEN Technologies, Inc.