I’m afraid I may already know the answer to this. Can I change a single text box’s size and (squint) font? If it has already been asked and answered I am not finding it. Having said that I’m probably just not finding it?
Yes, you can:
Infragistics.Win.Appearance app1 = new Infragistics.Win.Appearance();
((Ice.Lib.Framework.EpiTextBox)Inputs.StripDisplay.Control).UseAppStyling = false;
app1.FontData.Name = "Lucida Console";
((Ice.Lib.Framework.EpiTextBox)Inputs.StripDisplay.Control).Appearance = app1;
I do it on the page loaded event.
Here are some other controls that you can change using the product configurator.
//This sets the focus on the field specified… useful when user clicks a checkbox, you can have the focus change to another field. Found if you do this in the on-field-changed of a combo that the combo it’s in doesn’t correctly populate.
Inputs.MyTextField.Control.Focus();
//Changing foreground and background colors… if you want to do this, you must always turn UseAppStyling to false for this to work. This is a field by field setting.
Inputs.MyButton.ForeColor = Color.Blue;
Inputs.MyButton.Control.UseAppStyling = false;
//Changing Combo Box colors
Inputs.MyCombo.Control.Forecolor Color.Blue;
Inputs.MyCombo.Control.Backcolor Color.Red;
Inputs.MyCombo.Control.UseAppStyling = false;
//I have used this a lot to make sure that the pictures are behind the input fields. you can do the same with the gray boxes to bring them forward or back.
Inputs.epiPcPictureBox1.Control.SendToBack();
Inputs.MyTextField.Control.BringToFront();
//Change Label Fonts… I did this with a heading font, but I think I also tried this out in a field as well. Since our FIELD label fields are not created by us, I don’t know how to access the prompt field for a normal text/decimal/combo/Bool field to change it.
FontFamily family = new FontFamily(“Times New Roman”);
Font font = new Font(family, 20.0f, FontStyle.Bold );
Inputs.MyLabel.Control.BackColor = System.Drawing.Color.Black; //more ugly controls… but can be done
Inputs.MyLabel.Control.ForeColor = System.Drawing.Color.Red; //more ugly controls… but can be done
Inputs.MyLabel.Control.Font = font;
Inputs.MyLabel.Control.UseAppStyling = false;
And I get…
Error CS0246: The type or namespace name ‘Infragistics’ could not be found (are you missing a using directive or an assembly reference?) [_E_Configurator_1279ServerEvents.cs(40,4)]Error CS0246: The type or namespace name ‘Infragistics’ could not be found (are you missing a using directive or an assembly reference?) [_E_Configurator_1279ServerEvents.cs(40,43)]Error CS0234: The type or namespace name ‘Framework’ does not exist in the namespace ‘Ice.Lib’ (are you missing an assembly reference?) [_E_Configurator_1279ServerEvents.cs(41,11)]Error CS1061: ‘Erp.Internal.Cfg._E_Configurator_1279.TEST2._E_Configurator_1279InputValueCollection’ does not contain a definition for ‘StripDisplay’ and no extension method ‘StripDisplay’ accepting a first argument of type ‘Erp.Internal.Cfg._E_Configurator_1279.TEST2._E_Configurator_1279InputValueCollection’ could be found (are you missing a using directive or an assembly reference?) [_E_Configurator_1279ServerEvents.cs(41,39)]Error CS0234: The type or namespace name ‘Framework’ does not exist in the namespace ‘Ice.Lib’ (are you missing an assembly reference?) [_E_Configurator_1279ServerEvents.cs(43,11)]Error CS1061: ‘Erp.Internal.Cfg._E_Configurator_1279.TEST2._E_Configurator_1279InputValueCollection’ does not contain a definition for ‘StripDisplay’ and no extension method ‘StripDisplay’ accepting a first argument of type ‘Erp.Internal.Cfg._E_Configurator_1279.TEST2._E_Configurator_1279InputValueCollection’ could be found (are you missing a using directive or an assembly reference?) [_E_Configurator_1279ServerEvents.cs(43,39)]
Put it in On Page Loaded not Load
The following errors were found during compile:
CS1061 - c:\Users\mark.gardella\AppData\Local\Temp\70\ConfigDump\Client_E_Configurator_1279PageEventCollection.cs (63,39) - ‘Erp.UI.Cfg.TEST343a5e4a1ec44623b3ef4f3b3242d793._E_Configurator_1279InputControlCollection’ does not contain a definition for ‘StripDisplay’ and no extension method ‘StripDisplay’ accepting a first argument of type ‘Erp.UI.Cfg.TEST343a5e4a1ec44623b3ef4f3b3242d793._E_Configurator_1279InputControlCollection’ could be found (are you missing a using directive or an assembly reference?)
CS1061 - c:\Users\mark.gardella\AppData\Local\Temp\70\ConfigDump\Client_E_Configurator_1279PageEventCollection.cs (65,39) - ‘Erp.UI.Cfg.TEST343a5e4a1ec44623b3ef4f3b3242d793._E_Configurator_1279InputControlCollection’ does not contain a definition for ‘StripDisplay’ and no extension method ‘StripDisplay’ accepting a first argument of type ‘Erp.UI.Cfg.TEST343a5e4a1ec44623b3ef4f3b3242d793._E_Configurator_1279InputControlCollection’ could be found (are you missing a using directive or an assembly reference?)
Total number of Errors: 2, Warnings 0
Is StripDisplay the name of your input control? You will have to use Inputs.NAME OF YOUR CONTROL.Control
Ouch! Thank you Dan! Good stuff…
How do I change the font size and other attributes of the text box?
A few more
app1.FontData.SizeInPoints = 10;
app1.BackColor = Color.White;
app1.FontData.Name = "Verdana";
app1.FontData.Bold = Infragistics.Win.DefaultableBoolean.True;
And for TextBox size
Inputs.epiPcTextBox1.Control.Size = new Size(10,20);
I typically put all my formatting code into a Client Side UD method and then call that from Page Loaded. Nice way to keep the code structured a bit
Thank you much! Last question for the thread I think, where would I find the above if I didn’t have the gurus here to find it for me?
You might be able to find bits and pieces in various pieces of Epicor documentation but for the most part I think this site will always be your #1 resource… Some real good peeps on here.
I used IL Spy (.NET Decompiler) and opened \Client\Ice.Lib.EpiClientLib.dll
Then I found the Infragistics.Win.AppearanceBase
class which lead me to the FontData class. Its a lot faster if someone can just tell you though.
great question… sorry that there is not a great answer (except what @danbedwards said)… The “Controls” that are available are standard C# controls… I found all the ones I posted above by searching “C# Controls” on the internet, which eventually gets you to pages like this Microsoft Text Controls website and I found many controls that were available, but not all worked… had to do some trial and error.
Hi Tim,
I’m having an issue trying to set the background color (Inputs.myButton.Control.BackColor) for an epiButton in configurator. My OnPageLoaded expression (below) seems to work perfectly except the background color. Is there something I’m missing on setting the backcolor? or is it another property on Infragistics.Win.Appearance?
I think this will work
Inputs.myButton.Control.UseAppStyling = false;
Inputs.myButton.Control.UseOsThemes = Infragistics.Win.DefaultableBoolean.False;
Inputs.myButton.Control.Appearance.BackColor = Color.Red;