Changing Field colors

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jtaljaard
Posts: 37
Joined: Thu Sep 21, 2023 9:29 pm

Changing Field colors

Post 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?
Joerg Hamacher
Posts: 120
Joined: Thu Feb 11, 2016 12:01 am

Re: Changing Field colors

Post 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
jtaljaard
Posts: 37
Joined: Thu Sep 21, 2023 9:29 pm

Re: Changing Field colors

Post by jtaljaard »

Tested it out now and works like a charm!! Thanks for the assistance Jörg.
Post Reply