changing the button color at runtime [message #540240] |
Sat, 21 January 2012 01:49 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/169665.jpg) |
nareshvictory
Messages: 52 Registered: December 2011 Location: chennai
|
Member |
|
|
hi all,
i want to change the button color in the runtime. is it possible
by using set_item_property. if not, can we set by using property palette at design time.
i tried by setting the property in both ways but it's not working
any suggestions accepted
|
|
|
Re: changing the button color at runtime [message #540254 is a reply to message #540240] |
Sat, 21 January 2012 03:02 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I don't have Forms here (especially 6i version) so I can't check Online Help, but Forms 9i documentation says that BACKGROUND_COLOR is valid for items, tab pages, radio buttons, canvases and windows. Buttons aren't mentioned, so I *suppose* that you can't do that. Though, someone might know better.
Possible workaround? Create two buttons, one on the top of another, with different background colors. Then, during runtime, display/hide them - to the end user, it would be the same as if a button changed its color.
In order to easily maintain code behind the button (i.e. WHEN-BUTTON-PRESSED trigger), put its code into a procedure and simply call that procedure from both buttons' WHEN-BUTTON-PRESSED triggers.
|
|
|
|
|