Display toolbar icons on form button

H

hooksie2

If I know the FaceID of a commandbar picture I can easily display it on
a toolbar button. But what if I want to display the picture on a form
button?

The only way I can think of is to make a screen shot of the icon and
save it as a bitmap so that I can then link it to my button. This
seems pretty messy though - does anyone know of a more straight foward
approach?

Thanks in advance,
Andrew
 
K

keepITcool

Andrew,

Following approach works for xlXP and xl2003 only..


Private Sub UserForm_Initialize()

With Application.CommandBars(1)
With .Controls.Add(temporary:=True)
.FaceId = 59
Me.CommandButton1.Picture = .Picture
.Delete
End With
End With
End Sub
 
R

ross

also, you can paste any bitmap on to a control, at design time, which
might be easier to do.

for example, get a scrren shot of the face ID, paste into paint, crop
the image down and copy agian, then select the picture properties of
the cmd, and press ctrl+p.

Ross
www.methodsinexcel.co.uk
 
K

keepITcool

I've done all the cropping and transparenting...
and made an icon library (ICL) with all 10000+ Office2003 icons.


Microsoft is not too keen on redistribution...
but if you are REALLY interested... goto my site.

Follow instructions.. and maybe you;ll get them.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


ross wrote :
 
A

Andrew

Thanks for the suggestions guys. Since I'm working with XL2000 your
first suggestion won't work for me. Guess I'm stuck with the
screen-shot approach. I tried to go to your website but it is blocked
for some reason?

Thanks again,
Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top