Hey All,
I’ve been finding a lot of information out there on how to get more robust configurator user interfaces. One thing that I have found very useful is setting event handlers. If you look at the class documentation for the Control class, there are many existing events that you can configure. I have used this functionality to change background colors of controls to indicate invalid entries. Here is the code to set the event handler:
Inputs.HangonSpeedrail2_cmb.Control.LostFocus += (s, e) =>
{
HangonSpeedRail2_LostFocus (false);
};
Here is the code to change the background colors of an UltraComboBox back and forth from red to default:
if (Inputs.Model_cmb.Control.Appearance.BackColor == Color.Red)
{
Inputs.Model_cmb.Control.Appearance.BackColor = Color.White;
Inputs.Model_cmb.Control.UseAppStyling = true;
}
else
{
Inputs.Model_cmb.Control.Appearance.BackColor = Color.Red;
Inputs.Model_cmb.Control.UseAppStyling = false;
}
Here is the code to change the background colors of a Decimal or TextBox:
if (Inputs.Model_dec.Control.BackColor == Color.Red)
{
Inputs.Model_dec.Control.BackColor = Color.White;
Inputs.Model_dec.Control.UseAppStyling = true;
}
else
{
Inputs.Model_dec.Control.BackColor = Color.Red;
Inputs.Model_dec.Control.UseAppStyling = false;
}
Enjoy!
Matthew