Shoutbox

Changing a buttons image? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Changing a buttons image? (/showthread.php?tid=72562)

Changing a buttons image? by effection on 03-11-2007 at 08:33 PM

i want to be able to change the image i am using to skin a button from a script and not have to edit the xml file. ive seen the function "ImageElmt_SetImageFile" but that is only to set image elements and i'm not sure how to use an image element to skin a button:S

any help would be appreciated


RE: Changing a buttons image? by Spunky on 03-12-2007 at 03:26 PM

Not sure it can be done... You could use a script to parse a new xml file each time a skin was created with the right file names etc (I've tried this before btw)


RE: Changing a buttons image? by effection on 03-12-2007 at 03:48 PM

yeah i was hoping not to result to that and just have  some regidtry settings :(


RE: Changing a buttons image? by the DtTvB on 03-12-2007 at 03:56 PM

What about using an image as the button's background and use some clickable control i.e. link control as the button's hotspot and/or text?


RE: Changing a buttons image? by markee on 03-12-2007 at 04:01 PM

A simple work around is to have an image control with a fully transparent button control sitting on top.  This way you can change the image easily while still having the button (you just lose the effects of what a button looks like when pressed).


RE: Changing a buttons image? by Eljay on 03-12-2007 at 09:09 PM

quote:
Originally posted by markee
A simple work around is to have an image control with a fully transparent button control sitting on top.  This way you can change the image easily while still having the button (you just lose the effects of what a button looks like when pressed).

Or to keep the state effects, use CustomLook in the button control to add an ImageElement that you can then change the image of. (I haven't tested this but in theory it should work... )
RE: Changing a buttons image? by NanaFreak on 03-12-2007 at 09:13 PM

quote:
Originally posted by Eljay
quote:
Originally posted by markee
A simple work around is to have an image control with a fully transparent button control sitting on top.  This way you can change the image easily while still having the button (you just lose the effects of what a button looks like when pressed).

Or to keep the state effects, use CustomLook in the button control to add an ImageElement that you can then change the image of. (I haven't tested this but in theory it should work... )
yea you can just use the CustomLook and change the images each time (tested it :P)

RE: Changing a buttons image? by effection on 03-12-2007 at 10:14 PM

any examples? i haven't used custom look or an image element for that fact