# How to set Color in the button

**URL:** <https://forum.kirupa.com/t/how-to-set-color-in-the-button/195350>\
**Category:** Uncategorized\
**Created:** [July 31, 2006, 4:44am UTC](https://forum.kirupa.com/t/how-to-set-color-in-the-button/195350 "2006-07-31T04:44:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![trestian](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@trestian](https://forum.kirupa.com/u/trestian)\
**Post date:** [July 31, 2006, 4:44am UTC](https://forum.kirupa.com/t/how-to-set-color-in-the-button/195350/1 "2006-07-31T04:44:35Z")

</div>

Good Day!

Can anybody help me on how to set a color in the buttons in loading event?

My Code:

var colorful = new Color("\_root.btn1");  
colorful.setRGB(15329767);

bur I got an error like this.  
Error Message: Statement must appear within on handler

my scenario is:

i have group of boxes then i change it to symbol buttons. and every buttons have a corresponding colors. and i want to color the buttons.

Your Help is greatly appreciated
