Hi Finitha,
In the PBO Event of the screen suppose the NAME of your button is DynButton
You can code like this
IF condition OK.
write icon_green_light as icon to DynButton.
concatenate DynButton 'Process'
into DynButton
separated by space.
ELSE.
write icon_red_light as icon to DynButton.
concatenate DynButton 'Block'
into DynButton
separated by space.
ENDIF.
Regards