static browse attribute

jad sakr

New Member
Hi!

I'm trying to change the font of a specific calculated field in a static browse unsuccessfully. I'm not being able to select this field in order to assign the FGCOLOR property.

Any help would be appreciated.
 
try this
PROCEDURE Br-Label :
def input param br-hand as handle no-undo.
def var v-hand as handle no-undo.
v-hand = br-hand:first-column.
do while valid-handle(v-hand):
/* check its the column we want by checking label */
if v-hand:label = 'whatever' then
v-hand:xxxxx = yyyyyy. /* do the change */

v-hand = v-hand:next-column.
end.
END PROCEDURE

not sure if you can change font at run time might have to do it before browse is realised. you check other things to see if its the column you want depends how generic you want it to be.
 
Thanks for your help, but i don't think i clarified my request clear enough : i don't want to change the color of the whole column in the browser, i just want to change the color of a specific field (row in the browser) based upon the value of this field: for exemple i want all the records in the browser that have a negatif value in the balance field (which is a concatenated field) to be displayed in red.

thanks again
Jad
 
Hi, I think, You need something like this

ON ROW-DISPLAY OF BROWSE-MY IN FRAME DEFAULT-FRAME
DO:
IF customer.Cust-num > 5 THEN
Cust-num:BGCOLOR IN BROWSE BROWSE-MY = 14.
END.
 
Hi! Thanks for your answer. But the field i want to change the color of in the browse is a calculated field so i cannot reference it as "customer.cust-num:BGColor". The only unique identifier that i have for this field is the label of the browse and i cannot select the field with this property in order to change its color.thanks again.

Jad
 
try this

>> You can declare handle in def block:

/* ************************* Definitions ************************ */

/* Parameters Definitions --- */

/* Local Variable Definitions --- */

DEFINE VARIABLE hCalcCol AS HANDLE NO-UNDO.


>> next You set handle in main block with column number of Your calc-column

hCalcCol = BROWSE-1:GET-BROWSE-COLUMN(5).

RUN enable_UI.

>> next write trigger

ON ROW-DISPLAY OF BROWSE-1 IN FRAME DEFAULT-FRAME /* Browse 1 */
DO:
IF(any-condition) THEN
hCalcCol:BGCOLOR = 14.
END.
 
Back
Top