Page 1 of 1
Changing Field colors
Posted: Mon Oct 23, 2023 7:21 pm
by jtaljaard
What is the syntax used to change the color of a border of a combo box if nothing has been entered in the field to red at runtime?
Re: Changing Field colors
Posted: Mon Oct 30, 2023 8:05 pm
by Joerg Hamacher
You can handle this wih styles and events like this (web page):
Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME<MaterialDesignBlue>)
Define_Com Class(#PRIM_VS.Style) Name(#Style1) Borderbottom(1) Borderbrush(#Brush1) Borderleft(1) Borderright(1) Bordertop(1)
Define_Com Class(#PRIM_VS.SolidBrush) Name(#Brush1) Color(Red)
Define_Com Class(#STD_TEXT.EditField) Name(#STD_TEXT) Displayposition(1) Left(142) Parent(#COM_OWNER) Tabposition(1) Top(100)
Define_Com Class(#STD_TEXTS.EditField) Name(#STD_TEXTS) Displayposition(2) Left(147) Parent(#COM_OWNER) Tabposition(2) Top(243)
Evtroutine Handling(#Com_owner.Initialize)
Endroutine
Evtroutine Handling(#STD_TEXT.Changed #STD_TEXT.LostFocus)
If (#STD_TEXT = *Blanks)
#STD_TEXT.Style <= #Style1
Else
#STD_TEXT.Style <= *NULL
Endif
Endroutine
End_Com
Best regards,
Jörg
Re: Changing Field colors
Posted: Mon Oct 30, 2023 8:29 pm
by jtaljaard
Tested it out now and works like a charm!! Thanks for the assistance Jörg.