Results 1 to 10 of 10
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Graphics in Menus (VB 6 and VBA)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> loungers

    In Windows applications, such as MS-Word and MS-Excel and VB, some times you see an icon on the menu next to the menu text.

    Like the save has the disk, and the Open has the yellow folder and what have you... New with a document and print with a printer

    How do you get these icons to appear in your VB application?

    Could it be done via the menu editor?

    Thanks in Aadvance.

    Wassim <img src=/S/compute.gif border=0 alt=compute width=40 height=20>
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  2. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Graphics in Menus (VB 6 and VBA)

    This works just like a custom menu button on a toolbar, because the menu bar is just another toolbar. Right-click on any toolbar and select customize. On the commands tab, Macros category, drag the custom button to the menu bar, and then drop it next to the menu item where you want it. To set the options for this new item, left-click the top-level menu to drop it down, then right-click on the new menu "button" and set the options that you want. HTH --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Graphics in Menus (VB 6 and VBA)

    Uh-oh, just noticed that this is the VBA board, so you want some code. Sort-of fresh out, but if I remember, I just copied an icon from the clipboard. Rest of the code is similar to this thread. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Graphics in Menus (VB 6 and VBA)

    If you just want to use the graphics, you can right click a toolbar, select customize from the shortcut menu and then right click on any button. One of the options is Copy Button Image. That will give you a bitmap of the graphic that you can paste into your application.
    Charlotte

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Graphics in Menus (VB 6 and VBA)

    You can also access the FaceID images built into Office using this handy Dave Rado abbreviated list downloadable from the Word MVP site (thank you Charles K). There is also a more comprehensive list contained in this attachment from a rather long Excel thread. HTH
    Gre

  6. #6
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Graphics in Menus (VB 6 and VBA)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Charlotte

    Thanks for your response. But it seems that all the members who responded to me missed the fact that I was talking about Visual BASIC and not VBA or any Office application.

    In Visual BASIC there is no Right-Mouse-Click on menus in Forms during design mode, or maybe I am just not using the right fingers to make it work.

    Also if you have come across any source of information about designing menus in Visual BASIC 6 I would be greatfull if you would point me to them.

    Wassim <img src=/S/compute.gif border=0 alt=compute width=40 height=20>
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  7. #7
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Graphics in Menus (VB 6 and VBA)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> unkamunka

    Thanks a lot for all that work, at least I can use it in my VBA applications.

    Unforytunatly I was looking for menu information for my Visual BASIC 6 application, and VBA and Office seem to have a bit different menu controls than Visual BASIC.

    Any ideas about Visual BASIC and menu building will be greatly appricated.

    Thanks again

    Wassim <img src=/S/compute.gif border=0 alt=compute width=40 height=20>
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Graphics in Menus (VB 6 and VBA)

    I don't think we missed the fact. It works the same way in VB6 as it does in the VBE in any of the Office apps. I understood you to wanted to copy toolbar button images. To copy toolbar button images, you have to right click a toolbar and select Customize first before you have access to the shortcut menu that allows you to copy the button image.

    It wasn't clear to me, however, that you were trying to copy the images to use *IN* VB menus. Menus in VB are different from VBA, since they actually go on a form rather than on a main application window. They're really quite straight forward, but adding icons to them is neither straight forward nor simple. You can certainly copy the images, but according to the articles I've read, adding icons to the menus requires extensive subclassing and I've never tried to do it.

    I'd suggest that if you want to pursue that code, you should start with an internet search on "Visual Basic menu icons". If you just want to put the icons on buttons on the form (which is what I had originally assumed), try this article for the basics of doing so.
    Charlotte

  9. #9
    New Lounger
    Join Date
    Mar 2002
    Location
    Connecticut, USA
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Graphics in Menus (VB 6 and VBA)

    Hi There,

    I would say this probably wasn't the best place to post, but...

    In VB you would have to use a third party control that mimics the Office commandbar styles and behaviors.

    There are at least a couple on the market.

    Here is one called ActiveBar.

    Here is another one from Infragistics (used to be Sheridan) called UltraToolbars.

    I have no personal experience with either so I can't vouch for them. Both of the original companies that developed these have been bought out or merged since they were originally created. The ActiveBar was originally produced by the same company that created the VSFlexGrid control which was very highly regarded.

    Good luck.

  10. #10
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Graphics in Menus (VB 6 and VBA)

    It seems to me like an entirely appropriate place for your post. I' work primarily in Access and I avoid 3rd party controls for many reasons, but there's nothing inherently wrong with them.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •