Results 1 to 8 of 8

Thread: how to add a small picture in form menu.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    how to add a small picture in form menu.

    i want add a small picture in form menu.when click the picture,the menu list like "maximize,minimize,close.."will pop up. How to write the code?

  2. #2
    Hyperactive Member Capp's Avatar
    Join Date
    May 2005
    Location
    Texas
    Posts
    409

    Re: how to add a small picture in form menu.

    well, if you are referring to something similar to the Control icon that is at the top-left corner of most forms that allows you to Minimize, Maximize, close etc..
    That is built-in and shows up by default.


    If you are just wanting to make your own for anywhere on the form, you can put an image on the form (we'll call it image1)

    Then use the VB Menu Editor to create a menu structure that has the items you want to include. Set the first item in the menu to false so it doesn't show up at the menu bar at the top.

    Then you can do something like this:

    vb Code:
    1. Private Sub image1_Click()
    2.  
    3. Me.PopUpMenu mnuYourMenuName
    4.  
    5. End Sub

    This will cause the menu to popup when you click the image.


    If this is not what you are looking for, then I apologize for leading you in the wrong direction
    AmazingAntivirus.com
    Remote Data Backups


    Please Mark your Thread "Resolved", if the query is solved...

    If a post has helped you then Please Rate it!

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how to add a small picture in form menu.

    Are you asking how to add icons to a standard VB drop down menu?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    Re: how to add a small picture in form menu.

    Quote Originally Posted by Capp
    well, if you are referring to something similar to the Control icon that is at the top-left corner of most forms that allows you to Minimize, Maximize, close etc..
    That is built-in and shows up by default.
    what i want is similar to control icon.

  5. #5
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: how to add a small picture in form menu.

    You can set the icon from Form's Icon property. Is it what you want ?

    If not, could you please describe a little more ? Perhaps with a picture ?
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: how to add a small picture in form menu.

    I think he wants to add another control box to the form. You can't do it in VB without subclassing the form and drawing it yourself.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  7. #7

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    Re: how to add a small picture in form menu.

    Quote Originally Posted by Hack
    Are you asking how to add icons to a standard VB drop down menu?
    can somebody provide more in add icons to a standard VB drop down menu?

  8. #8
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: how to add a small picture in form menu.

    You'll need SetMenuItemBitmaps API for this. See this pages:
    http://support.microsoft.com/kb/71281
    http://allapi.mentalis.org/apilist/S...mBitmaps.shtml (example at bottom of the page)
    also search the forum for "SetMenuItemBitmaps".

    hope it helps.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


Posting Permissions

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



Click Here to Expand Forum to Full Width