Picture to a command button

Can anybody tell me how I can add a .jpg or .bmp or .ico to a command button. I have tried the Command1.Picture = Picture1.Picture and also selecting the picture in the command button properties. Nothing has worked. When I run my app, the picture is nowhere to be seen. Can someone please help me? This seems so simple.

I am using VB 6.0.

TIA,
especht
espechtAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mark2150Connect With a Mentor Commented:
Got to set the .Style to graphical for anything to show up...

M
0
 
Brendt HessSenior DBACommented:
Change the style property to Graphical on your command button, and the picture will show.
0
 
GivenRandyCommented:
Why not use a PictureBox instead?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
mark2150Commented:
bhess1 - too slow! :-)

M
0
 
trick_jcCommented:
*******  try this ******

command1.style = 1
command1.picture = "picture path"

if you want text just do

command1.text = "Wanted text"

else

command1.text = ""
0
 
Brendt HessSenior DBACommented:
mark2150 - Well, neener to you, too! ;)
0
 
visualfoolCommented:
I think i saw something at http://616.org
0
 
Erick37Commented:
??
trick:

command1.style = 1

Read only, isn't it?
0
 
mark2150Commented:
Just set it to "Graphical" on properties page for button. "1" is "graphical"'s value.

M
0
 
cys050200Commented:
you must change the 'style' to graphical in your form properties.
For example, you have created a button named 'button1", you need to change the 'style' to become graphical, then only import the picture path from the properties.

You can either double click the 'button1' and type the following code:
button1.style = 1  'the style is true
button1.picture= "C:\windows\clouds.bmp"
'just an example of the picture path'

The button1. will change the color with these steps...
0
 
mark2150Commented:
cys,

Welcome to E-E.

However, as a new member you need to know that it's considered impolite to post an "answer" that is the same as previously posted comments.

If you read the thread you'll see at least *FOUR* experts have given the same "answer" as you - all correct I might add. By posting an "answer" it gives the impression that you're "point grabby" and it does a dis-service to the questioner in that having "answered" his Q you move it from the "Awaiting Answer" category to the "Locked" category and therefore fewer experts will review the question.

Since the questioner can accept any comment as an answer there is no risk that you will "lose" points by posting comments.

M
0
 
espechtAuthor Commented:
cys,

Like mark2150 explained above, I appreciate your answer, but there were people who proposed the exact same correct answer before you.

mark2150 - I am going to award the points to you for this question. Thank you!

bhess1 - Since you and mark2150 posted the same answer at the exact same time, I will post another question for you to answer and award you 30 points also.

Thanks for all the time and information!

especht
0
 
mark2150Commented:
Thank you!

M
0
 
Brendt HessSenior DBACommented:
Thank you - you didn't need to do that, but I appreciate it.
0
 
espechtAuthor Commented:
bhess1,

No problem. It's only fair. Your question can be found at  http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=10341727

Thanks again!
especht
0
All Courses

From novice to tech pro — start learning today.