Home » Developer & Programmer » Forms » forms push button color (forms6i)
forms push button color [message #326892] Fri, 13 June 2008 00:15 Go to next message
srinivas.k2005
Messages: 334
Registered: August 2006
Senior Member
Hi,

i am trying to set the push button color , but it is not changing.

i have set a visual attribute VA_RED

Written Code
Set_item_property('blk.push_button',VISUAL_ATTRIBUTE,'VA_RED');


but it is not atall changing the color,i tried in many ways.
Any idea why the color is not chnaging

Thanks,
Srinivas

Re: forms push button color [message #326908 is a reply to message #326892] Fri, 13 June 2008 01:05 Go to previous messageGo to next message
srinivas.k2005
Messages: 334
Registered: August 2006
Senior Member
Hey i got the solution i changed the iconic property of the button to YES and it worked.
Re: forms push button color [message #326919 is a reply to message #326908] Fri, 13 June 2008 01:50 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Take care not to create a christmas-tree.
Buttons and other widgets should inherit their properties from the OS-settings.
Re: forms push button color [message #326978 is a reply to message #326892] Fri, 13 June 2008 05:02 Go to previous messageGo to next message
dhanuka.rajesh
Messages: 49
Registered: March 2008
Location: Mumbai
Member
Try using icons.
Re: forms push button color [message #327081 is a reply to message #326978] Fri, 13 June 2008 12:32 Go to previous messageGo to next message
srinivas.k2005
Messages: 334
Registered: August 2006
Senior Member
Oh one more problem, now i can change color but i cannot see the label on it.
Example: i have button with name as SORT,once i change the color using iconic property it will not show the label on button,i know iconic property is only for icons, but any alternate way to change the color of the button.
Re: forms push button color [message #327095 is a reply to message #327081] Fri, 13 June 2008 15:03 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Perhaps I'm missing something here, but - why don't you simply open push button's Property Palette, go to Color node and set "Foreground Color" and "Background Color" properties to desired values?

Or, if you insist on modifying its color programatically, why not directly change background and foreground colors?
set_item_property('push_button6', background_color, 'r255g0b0');
set_item_property('push_button6', foreground_color, 'r0g255b0');
Note that colors must reference RGB values.

Or, create visual attribute and apply it to the button:
set_item_property('push_button6', visual_attribute, 'va');


All of these options will modify button background color and text (label) color. How do I know? I've tested the right now.

Basically, it is extremely difficult to fail to do that; I can't imagine what might have gone wrong.
Re: forms push button color [message #327100 is a reply to message #327095] Fri, 13 June 2008 16:31 Go to previous messageGo to next message
srinivas.k2005
Messages: 334
Registered: August 2006
Senior Member
Probabaly problem with my forms builder.

I tried a sample example , a form(forms 6i) with a button(push_button6) on canvas:

And the below code in when new form instance:

set_item_property('push_button6', background_color, 'r255g0b0');
set_item_property('push_button6', foreground_color, 'r0g255b0');

It did not work.Sad

Again i tried with Visual Attribute :

set_item_property('push_button6', visual_attribute, 'VA');

NO LUCK!

if it works fine for you, then may be problem with my forms
Re: forms push button color [message #327108 is a reply to message #327100] Fri, 13 June 2008 17:49 Go to previous message
srinivas.k2005
Messages: 334
Registered: August 2006
Senior Member
Hey i found that in web it works fine, but in non web it will not reflect.
Previous Topic: set_item_property from another block
Next Topic: How to display th e data
Goto Forum:
  


Current Time: Sat Dec 03 13:56:43 CST 2016

Total time taken to generate the page: 0.04470 seconds