?
Solved

Picture to a command button

Posted on 2000-05-09
15
Medium Priority
?
255 Views
Last Modified: 2010-05-02
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
0
Comment
Question by:especht
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +5
15 Comments
 
LVL 12

Accepted Solution

by:
mark2150 earned 120 total points
ID: 2794369
Got to set the .Style to graphical for anything to show up...

M
0
 
LVL 32

Expert Comment

by:Brendt Hess
ID: 2794372
Change the style property to Graphical on your command button, and the picture will show.
0
 
LVL 9

Expert Comment

by:GivenRandy
ID: 2794375
Why not use a PictureBox instead?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 12

Expert Comment

by:mark2150
ID: 2794420
bhess1 - too slow! :-)

M
0
 

Expert Comment

by:trick_jc
ID: 2794491
*******  try this ******

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

if you want text just do

command1.text = "Wanted text"

else

command1.text = ""
0
 
LVL 32

Expert Comment

by:Brendt Hess
ID: 2794527
mark2150 - Well, neener to you, too! ;)
0
 

Expert Comment

by:visualfool
ID: 2794529
I think i saw something at http://616.org
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2794633
??
trick:

command1.style = 1

Read only, isn't it?
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2795157
Just set it to "Graphical" on properties page for button. "1" is "graphical"'s value.

M
0
 

Expert Comment

by:cys050200
ID: 2795207
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
 
LVL 12

Expert Comment

by:mark2150
ID: 2795854
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
 

Author Comment

by:especht
ID: 2795940
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
 
LVL 12

Expert Comment

by:mark2150
ID: 2796265
Thank you!

M
0
 
LVL 32

Expert Comment

by:Brendt Hess
ID: 2796916
Thank you - you didn't need to do that, but I appreciate it.
0
 

Author Comment

by:especht
ID: 2797416
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question