Page 1 of 1

using System.Drawing.COlor for hex color values

Posted: Mon Dec 14, 2015 3:05 pm
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?

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

Posted: Tue Jan 21, 2020 3:07 pm
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.