using System.Drawing.COlor for hex color values

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
JStephenson
Posts: 2
Joined: Mon Dec 14, 2015 2:27 pm

using System.Drawing.COlor for hex color values

Post by JStephenson »

Im tring to set the Fill color of a button in a script, and in the page script I added:

Code: Select all

System.Drawing.Color projectBlue = System.Drawing.ColorTranslator.FromHtml("#2D6BB7");

	void myButton_Click(System.Object sender, System.EventArgs e)
		{
			myButton.Fill = Color.projectBlue;
		}
I get errors about the type of namespace name 'ColorTranslator' does not exist in the namespce 'System.Drawing'. What is the issue here? Is there an easier way to chnage the background color of a button when pressed, or at least set some latching state?

User avatar
Jae V
Posts: 118
Joined: Wed Jan 15, 2020 11:00 am

Re: using System.Drawing.COlor for hex color values

Post by Jae V »

Hello,
We understand that this is a very old post. However there is a easier way to do this in iX Developer. Under the property grid on a object, next to the Fill field there is a Cog. The Cog allows you to set up dynamic color based on a tag value. If there is anyone who is still having issues with this and require assistance, please visit us at https://www.beijerelectronics.us/en-US/ ... ___support or give us call at 801.708.6690. Thank you.
Best regards,
Jason
(801) 708-6690
Technical Support
Contact Us



Beijer Electronics AB
http://www.beijerelectronics.us

Post Reply