What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Setting button image during runtime

Setting button image during runtime
Author: Message:
tribbium
Junior Member
**


Posts: 34
Reputation: 3
– / Male / Flag
Joined: Jul 2008
O.P. Setting button image during runtime
Note: This is in reference to buttons that are not using CustomLook where the image is set inside the default grey rectangular button.

An example button containing an image follows:
code:
<Control xsi:type = "ButtonControl" Id = "EditQuestion">
    <Position Left = "56" Top = "105" Width = "80" Height = "13"/>
    <Image>
        <Name>add</Name>
    </Image>
</Control>

I want to be able to change the Image used during runtime. Since the image is not encapsulated in an ImageElement, I cannot use the function ImageElmt_SetImageFile to set it. How would you go about doing this?
Are you and your friends trivia enthusiasts? Download Tribbium! http://www.msgpluslive.net/scripts/view/427-Tribb...ia-Gaming-System)/

Download questions for Tribbium here:
http://www.tribbium.tk
08-01-2009 12:51 AM
Profile E-Mail PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Setting button image during runtime
I'm fairly certain it's not possible, even using the API. Sorry.
<Eljay> "Problems encountered: shit blew up" :zippy:
08-01-2009 12:57 AM
Profile PM Find Quote Report
mathieumg
Full Member
***


Posts: 181
Reputation: 2
35 / Male / Flag
Joined: May 2004
RE: Setting button image during runtime
I'm pretty sure it can be done by using the PlusWnd.SendControlMessage function and this.

This post was edited on 08-01-2009 at 01:05 AM by mathieumg.
Official MessengerPlus! Live French Translator
Official StuffPlug 3 French Translator

:)
08-01-2009 01:05 AM
Profile E-Mail PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Setting button image during runtime
How would you get the Elements Id? Or would it just use the ID of the button control?
<Eljay> "Problems encountered: shit blew up" :zippy:
08-01-2009 09:31 AM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Setting button image during runtime
quote:
Originally posted by mathieumg
I'm pretty sure it can be done by using the PlusWnd.SendControlMessage function and this.
Good thinking, but I couldn't get it to work here. I created a HBITMAP from an image file and then tried to send its handle to a button control, but the button image didn't change. I think the button control of Plus! draws its image only on creation based on the XML and doesn't respond on messages such as BM_SETIMAGE. Too bad...
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-01-2009 09:58 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On