Setting background color to a field in a form:

Hi,

Instead of using display option() method, use active method.

Just change the auto declaration of the required cell to “Yes”..

lets say it is field1(name of the field in design).. in table1..

public int active()
{
int ret;
;

if (table1.stock == 0)
{
field1.colorScheme(FormColorScheme::RGB);
field1.backgroundColor(Winapi::rgb2int(255,0,0));
}
else
{
field1.colorScheme(FormColorScheme::RGB);
field1.backgroundColor(Winapi::rgb2int(255,255,255));
}

ret = super();

return ret;
}

This will help you..

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s