Home » Developer & Programmer » Forms » How to change the background color of a item at runtime (Forms 6i)
How to change the background color of a item at runtime [message #299100] Sat, 09 February 2008 05:50 Go to next message
dillango
Messages: 145
Registered: January 2008
Senior Member
Hi,

I would like to highlight (by way of changing background color) the coloum where the cursor is placed. How can I change it at run time?
I tried using set_item_property(itemname, background_color,'color name') but it did not worked.

Thanks in advance for your answer.

ILANGO
Re: How to change the background color of a item at runtime [message #299116 is a reply to message #299100] Sat, 09 February 2008 10:02 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
SET_ITEM_INSTANCE_PROPERTY might be the answer.
Re: How to change the background color of a item at runtime [message #299241 is a reply to message #299100] Mon, 11 February 2008 00:23 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Do you want to highlight the 'row', 'column', or 'item'? Are you using a 'tabular' or 'form' layout?

David
Re: How to change the background color of a item at runtime [message #299311 is a reply to message #299241] Mon, 11 February 2008 06:41 Go to previous messageGo to next message
dillango
Messages: 145
Registered: January 2008
Senior Member
Yes Mr.David.

I am using tabular form (Time sheet) and need to differntiate "weeklyoff" by highlighting the row.

I could able to partially succeed using set_item_instance property.

Mr.David, I personally looking your email which I need to sortout many issues which I am facing in my present project.

Can you please get in touch with d.ilango@yahoo.com ?

Regards, ILANGO

Re: How to change the background color of a item at runtime [message #299319 is a reply to message #299311] Mon, 11 February 2008 07:22 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
dillango wrote on Mon, 11 February 2008 13:41

I am using tabular form (Time sheet) and need to differntiate "weeklyoff" by highlighting the row.


I still think that SET_ITEM_INSTANCE_PROPERTY against every item in a row might do the job.
Re: How to change the background color of a item at runtime [message #299325 is a reply to message #299319] Mon, 11 February 2008 07:36 Go to previous messageGo to next message
dillango
Messages: 145
Registered: January 2008
Senior Member
Exactly Mr.Littlefoot,

I gave like this
Set_item_instance_property(:Systerm.cursor_item, Current_record, Visualattribute, v.name);

It is working fine.

Did yor read my other query raised just before?

Regards, ILANGO
Re: How to change the background color of a item at runtime [message #299676 is a reply to message #299325] Tue, 12 February 2008 23:25 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If 'weeklyoff' is NOT the current row then use Littlefoot's suggestion of the 'SET_ITEM_INSTANCE_PROPERTY' for the items in that row. I would set it as part of the 'post-query' trigger on the block, that is, "if :blk.row_type = 'weeklyoff' then do_set_items; end if;"

If you ONLY work on the 'weeklyoff' row then consider the 'Current Record Visual Attribute Group' at the block level at it is less coding.

David
Re: How to change the background color of a item at runtime [message #300631 is a reply to message #299676] Sat, 16 February 2008 23:54 Go to previous messageGo to next message
thomasscaria
Messages: 21
Registered: July 2007
Location: Kuwait
Junior Member
djmartin wrote on Tue, 12 February 2008 23:25
If 'weeklyoff' is NOT the current row then use Littlefoot's suggestion of the 'SET_ITEM_INSTANCE_PROPERTY' for the items in that row. I would set it as part of the 'post-query' trigger on the block, that is, "if :blk.row_type = 'weeklyoff' then do_set_items; end if;"

If you ONLY work on the 'weeklyoff' row then consider the 'Current Record Visual Attribute Group' at the block level at it is less coding.

David



how can this be achieved in forms 4.5 vesrion

regards
thomas
Re: How to change the background color of a item at runtime [message #300732 is a reply to message #300631] Sun, 17 February 2008 23:43 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Use the 'Current Record Atribute'.

David
Re: How to change the background color of a item at runtime [message #300968 is a reply to message #300732] Mon, 18 February 2008 19:08 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Received by PM from thomasscaria:
-----------------------------------------------------------------
Dear David
in a multi record block, the first item is a check box. i need to show the selected records with the check box checked in a different colour than the unchecked rows. pls advise how to do this

thanks in advance
Thomas
Re: How to change the background color of a item at runtime [message #300969 is a reply to message #300968] Mon, 18 February 2008 19:13 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please do not PM questions. Just post them.

Try using the 'Current Record Visual Attribute Group' at the block level, and maybe at the item level. Make sure that the 'Width' is greater then 5.

You could also play with the Foreground and Background Colors.

Review the 'set_item_instance_property(visual_attribute)'.

David
Previous Topic: How solve error WUF-201
Next Topic: synchronize function
Goto Forum:
  


Current Time: Mon Mar 10 20:11:45 CDT 2025