Quick Search for:  in language:    
WORKS,Very,short,code,Newly,updated,Display,b
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,011,557. lines
 Jobs: 117. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
Click here to see a screenshot of this code!A Simple Database WIth XP Design ( Without XP )
By Osen Kusnadi on 7/1

(Screen Shot)

Fractional Addition
By SAEED HASSAN on 7/1


Defrag at certain time
By Michael Nipper on 7/1


Click here to see a screenshot of this code!Extended Find Ver 2
By Roger Gilchrist on 7/1

(Screen Shot)

Y! Module
By NightCrawler on 7/1


Files Comperator (the right way)
By Jarry Claessen on 6/30


Simple UDP example
By Mick Walton on 6/30


CAPS Trigger
By Trevor Burley on 6/30


Auto clip picture
By Kenneth. Jakobsen on 6/30


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Multiple Clickable Bitmaps on a drop menu in a for

Print
Email
 

Submitted on: 2/14/1999
By: Patrick K. Bigley  
Level: Not Given
User Rating: By 100 Users
Compatibility:VB 4.0 (32-bit), VB 5.0, VB 6.0

Users have accessed this code 8878 times.
 
 
     Very short code! Newly updated and it WORKS! Display bitmaps instead of text on a drop menu, in a form. Use the VB Menu Editor to create a menu with sub menus, the code does the rest!! So easy you will slap yourself for using other people's lengthy drawn-out codes.

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

'**************************************
' Name: Multiple Clickable Bitmaps on a 
'     drop menu in a for
' Description:Very short code! Newly upd
'     ated and it WORKS! Display bitmaps inste
'     ad of text on a drop menu, in a form. Us
'     e the VB Menu Editor to create a menu wi
'     th sub menus, the code does the rest!! S
'     o easy you will slap yourself for using 
'     other people's lengthy drawn-out codes.
' By: Patrick K. Bigley
'
' Returns:Places images onto a menu
'
' Assumes:Create a form (Form1)
Add a module (Module1)
Add three image controls (Image1, Image2, Image3)
Assign a small BITMAP For Each Image Control In 
its picture property.
IMPORTANT: You need To create a Menu, so go to 
the VB Menu Editor (Ctrl+E) and create a main menu.
Then create 3 Sub Menus. It doesn't matter what you
name any of the menus or menu options because this
code does the work For you.
Copy and paste the API into a Module (Module1)
Copy and paste the rest of the code into
the form (Form1)
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     wCode.asp?txtCodeId=1394&lngWId;=1'for details.'**************************************

Private Sub Form_Load()

Dim hMenu As Long, hSubMenu As Long, MenuID As Long '**************Bonus Code Below********* ' ******************************** 'This bonus code adds a bitmap to the fo ' rm's main drop menu. Click the 'titlebar with the right mouse button to ' see thr effect. hMenu = GetMenu(Form1.hwnd) hMenu = GetSystemMenu(hwnd, 0) MenuID = 0 'MenuID = &HF120; 'This places the bitmap ' as first, but looks distorted 'when the option is not minimized. This ' is the "restore" option. X% = ModifyMenu(hMenu, MenuID, MF_BITMAP, MenuID, CLng(Image1.Picture)) '**************Bonus Code above********* ' ******************************** hMenu = GetMenu(Form1.hwnd) hSubMenu = GetSubMenu(hMenu, 0) 'The "0" here is For the first menu Item. 'A "1" can be used for the second and a ' "3" 'for the third and so on... 'You may not want all menu items to have ' images 'so you can skip a number MenuID = GetMenuItemID(hSubMenu, 0) 'The "0" here is For the first SUB menu Item. 'A "1" can be used for the second and a ' "3" 'for the third and so on... 'You may not want all SUB menu items to ' have images 'so you can skip a number X% = ModifyMenu(hMenu, MenuID, MF_BITMAP, MenuID, CLng(Image1.Picture)) MenuID = GetMenuItemID(hSubMenu, 1) X% = ModifyMenu(hMenu, MenuID, MF_BITMAP, MenuID, CLng(Image2.Picture)) MenuID = GetMenuItemID(hSubMenu, 2) X% = ModifyMenu(hMenu, MenuID, MF_BITMAP, MenuID, CLng(Image3.Picture)) 'Note: The entire code above can be copi ' ed and pasted below with 'different numbers for different menus a ' nd sub menus 'REMEMBER, go to the VB Menu editor (Ctr ' l+E) and create a menu item. 'Then create 3 sub menus. It doesn't mat ' ter what you 'name any of the menus or menu options. 'Tip: Bitmaps work best. GIFs that have ' invisible colors do not appear invisible ' 'and icon (*.ico) do not work at all. Us ' e Image controls instead 'of Picture controls to save resources. 'Comments to opus@bargainbd.com 'http://bargainbd.com/opusopus/top.htm End Sub


Other 32 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
4/26/1999 2:23:00 AM:norul
i would like to know how to put the 
icon besides each of the menu 
items.
please email me about the 
procedure or the source code if 
possible...!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/27/1999 7:28:00 PM:DW
This is such a cool thing, I have been 
looking for something like this to put 
in my program! Thanks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/22/1999 1:46:00 AM:Eugene
It is nice code. Thanks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/23/1999 1:31:00 AM:Rob
Excellent !!  Can you tell me how to 
show both text and pictures ??  What 
other constants are there ?? e.g. 
shadow text
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/23/1999 10:13:00 AM:Peter Ormsby
When I run the code this i get an error 
on this line in form1 :-
hMenu = 
GetMenu(Form1.hwnd)
Compile 
Error:
Invalid Outside 
Procedure.
Can you help?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/19/2001 8:56:07 AM:Vasilis Sagonas
EXCELLENT! Can I please know if I can 
add a bitmap on the left side of the 
menu (like the Start menu) ... PLEASE 
email me vasilis@lar.forthnet.gr. Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/20/2003 3:30:19 PM:ajay kumar
HI This is what i wa finding (have more 
But not for only this purpose) Thanx ya 
i will meke context menu thumbnail 
viewer now
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.