View Full Version : How to Change a Button's Image
07-25-2012, 07:45 AM
I hope that my question does not sily . But I could not manage this simple task .
I want to change my buttons overall look by selecting an image and I also want this button to change its image depending on mouse action ..
I tried to go along with the simple tuts in MEL command help page but I have not been able to get anything so far.
Best Regards ;
07-25-2012, 08:56 AM
what kind of button? a standard "button" doesn't support images at all, and the only button type that supports different state icons are the iconTextButton and it's relatives.
if you have a button that already exists and you want to change any property on it, all you need to know is it's name, then use the -edit flag:
symbolButton -edit -image "c:/icons/destroy.bmp" myButton1;
07-25-2012, 09:01 AM
Thank you so much NaughtyNathan;
Then , How can I specify the other states of the button ?
Like mouse over , pressed and the other stuff..
Is it done automatically ?
07-25-2012, 11:00 AM
you can't, unless it's an iconTextButton, and then you just specify a different image for each of it's states. just take a look in the MEL docs for this command.
07-25-2012, 11:04 AM
I did man .. I took a look at the MEL help pages for " iconTextButton " command ..
I will use this command OK .. That is for sure .. Thanks for the help ..
But there is nothing saying how to apply three stages of the button image in help pages..
"image1" "image2" and "image3" flags were the only thing that I could see ...
Is it What I am looking for ?
If you can write something simple for me, I will never nag you again..
07-25-2012, 11:16 AM
dude... it's all right there:
-disabledImage (-di) string
Image used when the button is disabled. Image size must be the same as the image specified with the i/image flag. This is a Windows only flag.
-selectionImage (-si) string
Image displayed while the control is selected. Image size must be the same as the image specified with the -i/image flag. This is a Windows only flag.
-highlightImage (-hi) string
Highlight image displayed while the cursor is over the control. Image size must be the same as the image specified with the -i/image flag. This is a Windows only flag.
07-25-2012, 11:27 AM
I do not know how to apologize .. Sorry to bother you like that ..
But sometimes things might get less visible when you do not know What to look for ..
You have been so helpfull ..
07-25-2012, 12:07 PM
no need to apologize dude, if it was a bother at all I simply wouldn't have bothered to reply. Better to give you a push in the right direction than simply hand you a line of code you may then not know how to adapt later, especially as this post may also serve to help someone else in the future.
07-25-2012, 12:07 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.