Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a button which selects a multiple values of a field when we clik on it. And another button which unselects the values when we click on it.
I want that the colour of the button should change when we clik on it.So that i can distinguish between the buttons that it is cliked and it is active.
hi rahul,
probably the following code should work
sub activate
set mybutton=activedocument.getsheetobject("BU01")
set prop= mybutton.getproperties
prop.bkgcolor.primarycol.col=rgb(0,255,0)
mybutton.setproperties prop
end sub
sub deactivate
set mybutton=activedocument.getsheetobject("BU01")
set prop= mybutton.getproperties
prop.bkgcolor.primarycol.col=rgb(255,255,255)
mybutton.setproperties prop
end sub
thanks
Thanks Tauqueer,
It has solved my purpose.It working as per my requirements.
Thanks a lot.
Regards,
Rahul
hey... great solution.
This is great when you have one button,
what if i have a series of button? says 2?
then i want them to toggel between each other?
I was thinking of if else statement for the button, but i couldn't find the vb script to detect which button is clicked?
Any hints?
Hi! Nic,
Well this can be done with 2 buttons you can write activate and deactivate script in two different buttons and then we can toggle between them.
Regards,
Rahul
Hi Rahul,
Thanks for the suggestion, following is my code for 2 button, if i have 10 buttons in different tabs, i'd have 10 sets?
I'm trying to find the vbcode for...
>> if button 16 is click, get the active button 16 - BU16... how to translate to vbscript?
any idea?
sub activate
set mybutton=activedocument.getsheetobject("BU16")
set prop= mybutton.getproperties
prop.bkgcolor.primarycol.col=rgb(0,255,0)
mybutton.setproperties prop
set mybutton=activedocument.getsheetobject("BU17")
set prop= mybutton.getproperties
prop.bkgcolor.primarycol.col=rgb(0,51,170)
mybutton.setproperties prop
end sub
sub activate2
set mybutton=activedocument.getsheetobject("BU17")
set prop= mybutton.getproperties
prop.bkgcolor.primarycol.col=rgb(0,255,0)
mybutton.setproperties prop
set mybutton=activedocument.getsheetobject("BU16")
set prop= mybutton.getproperties
prop.bkgcolor.primarycol.col=rgb(0,51,170)
mybutton.setproperties prop
end sub