Transparent images in toolbar button/menu ? 
Author Message
 Transparent images in toolbar button/menu ?
I am writing a com add-in which dynamically add's some menu's and toolbars
to word.  My problem is that when I use a function like the following to set
the picture on the button, the transparent colour dissapears.

Sub LoadPicture(oButton As CommandBarControl, img As Object)

    ' Copy an bitmap to the clipboard
    Clipboard.SetData img.Picture
    ' Copy the bitmap from the clipboard to the menu/toolbar command's icon.
    oButton.PasteFace

End Sub

Does anyone know how I can get my dynamic buttons to have a transparent
background colour ?



Sat, 22 Mar 2003 03:00:00 GMT  
 Transparent images in toolbar button/menu ?
Look at this article:
http://codeguru.earthweb.com/vb/articles/1862.shtml

It explains how to do it.
There doesn't seem to be an easier way...


Quote:
> I am writing a com add-in which dynamically add's some menu's and toolbars
> to word.  My problem is that when I use a function like the following to
set
> the picture on the button, the transparent colour dissapears.

> Sub LoadPicture(oButton As CommandBarControl, img As Object)

>     ' Copy an bitmap to the clipboard
>     Clipboard.SetData img.Picture
>     ' Copy the bitmap from the clipboard to the menu/toolbar command's
icon.
>     oButton.PasteFace

> End Sub

> Does anyone know how I can get my dynamic buttons to have a transparent
> background colour ?



Mon, 24 Mar 2003 03:00:00 GMT  
 Transparent images in toolbar button/menu ?
Thanks a lot, It seems to be the way to go, however I have one problem.

I have added a resource file to my com add-in, and when I call
CreateMappedBitmap passing app.hinstance, it tries to load the bitmap from
word's resource files, and not my add-in !

Any idea how can I get it to load the bitmap from the add-in's resources
instead ?


Quote:
> Look at this article:
> http://codeguru.earthweb.com/vb/articles/1862.shtml

> It explains how to do it.
> There doesn't seem to be an easier way...



> > I am writing a com add-in which dynamically add's some menu's and
toolbars
> > to word.  My problem is that when I use a function like the following to
> set
> > the picture on the button, the transparent colour dissapears.

> > Sub LoadPicture(oButton As CommandBarControl, img As Object)

> >     ' Copy an bitmap to the clipboard
> >     Clipboard.SetData img.Picture
> >     ' Copy the bitmap from the clipboard to the menu/toolbar command's
> icon.
> >     oButton.PasteFace

> > End Sub

> > Does anyone know how I can get my dynamic buttons to have a transparent
> > background colour ?



Tue, 25 Mar 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Adding images to toolbar button menus?

2. How to insert images in the dropdown toolbar button menu items in VB.

3. Pictures on Buttons - Transparent toolbar

4. Transparent pictures on toolbar buttons?

5. Help with Transparent Areas on ToolBar Buttons

6. Transparent buttons on toolbar control

7. Creating transparent images for toolbar

8. Transparent images in toolbar

9. Cyrstal Toolbar images not found src="/crystalreportwebformviewer/images/toolbar

10. Buttons with transparent background for menu bar?

11. Active/Inactive toolbar buttons/menu commands

12. Responding to Menu items and Toolbar buttons

 

 
Powered by phpBB® Forum Software