Add a menu item and a sub-menu to the main menu to the form.
Add a picture box to the form and set its visible property to False.
Add the following code to a general module (.BAS).(API Functions)
================================================= -
Public Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
-
Public Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
-
Public Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
-
Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
-
Public Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As Any) As Long
-
Public Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
-
Public Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
-
Add this code to the form load event.
============================== -
Picture1.Picture = LoadPicture(app.path & "\" & "CUT.BMP")
-
Dim D As Long, DU as Long
-
Dim H As Long
-
D = CreateCompatibleDC(Picture1.hdc)
-
H = CreateCompatibleBitmap(Picture1.hdc, 16, 16)
-
-
Dim P As Long
-
P = SelectObject(D, H)
-
DU = BitBlt(D, 0, 0, 16, 16, Picture1.hdc, 0, 0, &HCC0020)
-
DU = SelectObject(D, P)
-
D = ModifyMenu(GetSubMenu(GetMenu(Me.hwnd), 0), 0, &H404, 0, H)
-
0 5638 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Picho |
last post by:
Hi all,
Is there any .NET way (I am not rulling out API usage) to add button(s) to a
form's title bar?
I found some non-.NET solutions that did actually work in VB6 but not in the
..NET...
|
by: Monty R. Caywood |
last post by:
Is there a way to add a specific bitmap on a button?
|
by: Dave Quigley |
last post by:
Hello everyone.... Im currently starting my targa support project again for
..NET and I am wondering if there are any particular interfaces or classes
that Im supposed to extend in order to do this...
|
by: jay |
last post by:
I have a bitmap and a graphicspath object. I draw pixels on m_Bitmap and I'm
drawing text using m_Graphics GraphicsPath object.
However, saving my work with m_Bitmap.Save doesn't save...
|
by: Maheshkumar.R |
last post by:
How i can store images in array @ runtime..? What are the possbile ways..
Thankz..
-
Mähésh Kumär. R
|
by: Richard |
last post by:
On my webpage I am making I want that if users view any image in my gallery
a small logo/tekst will appear in the image.
I know it's possible but I haven't got a clue how to get a logo or tekst on...
|
by: Carl Gilbert |
last post by:
Hi
I have to following code which sets up a new bitmap.
'set up a transparent 16x16 bitmap
Dim bm As New Bitmap(16, 16)
Dim g As Graphics = Graphics.FromImage(bm)...
|
by: John Dann |
last post by:
I've never had much cause to read up in detail on GDI+ but there's a
small piece of a project where I need to add some annotation (let's
say just some small filled rectangles as markers) to a...
|
by: HeadOffice |
last post by:
Hi,
I'd like to have a context menu attached to my NotifyTrayIcon. Easy enough -
but I'd like to have one of those menus with a bitmap that runs down the
entire length of the menu (company name...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |