Hi , Im working on an owner drawn context menu.
I want to replace the regular submenu arrow with my own arrow,I went threw all the properties and overridable methods of menuitem and couldn't find a way to do that.Is it imposiable to make that arrow disapear so i could replace it ?
thanks in advance.
5 1396
you might need to use some third party control for the purpose.
Don't forget, through various Windows API calls there are numerous ways in which you can change the look of menu items, even placing pictures in the menu and so on. It's difficult to believe there isn't some way to achieve what you want through a similar mechanism. As well as "owner drawn" I seem to recall the term "subclassing" being used in connection with this. Perhaps some searching on this will help
On the other hand, changing such a fundamental part of the Windows interface might be a really bad idea.
I did a search on Google for "vb subclass menu". As always, of course, there were far too many results to even think about. But here were a couple that I thought sounded relevant, at first glance...
first thing , thanks everybody for answering.
I did a search on Google for "vb subclass menu". As always, of course, there were far too many results to even think about. But here were a couple that I thought sounded relevant, at first glance...
I Tried to hook the menu WndProc as you said but for some reson the WndProc i planted never gets called(The Context Menu is displayed Normally as if no alternative wndproc was set)
This is the code I wrote: - Const GWL_WNDPROC As Int32 = (-4)
-
Protected Overrides Function CreateMenuHandle() As System.IntPtr
-
Dim tmp As IntPtr = MyBase.CreateMenuHandle()
-
SetWndProc(tmp)
-
Return tmp
-
End Function
-
Protected Sub SetWndProc(ByVal hwnd As IntPtr)
-
m_ProcOld = SetWindowLong(hwnd, GWL_WNDPROC, Marshal.GetFunctionPointerForDelegate(New WindowProcCallback(AddressOf WNDProc)))
-
m_Hwnd = hwnd
-
End Sub
-
Protected Function WNDProc(ByVal hWnd As IntPtr, ByVal iMsg As UInt32, ByVal wParam As UInt32, ByVal lParam As UInt32) As Int32
-
Const WM_DRAWITEM As Int32 = &H2B
-
Const WM_DESTROY As Int32 = &H2
-
MsgBox("WndProc Called")
-
If (iMsg = WM_DRAWITEM) Then Return 0
-
If (iMsg = WM_DESTROY) Then
-
SetWindowLong(m_Hwnd, GWL_WNDPROC, m_ProcOld)
-
End If
-
Return CallWindowProc(m_ProcOld, hWnd, iMsg, wParam, lParam)
-
End Function
i used to have an application that alowed you to edit your contextmenus.........i wish i could remember the name....
ill get back to you here if i find it or remember it.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: James |
last post by:
Is there a way to Owner drawn tray context menu ? - I know that there is a
bug with the custom drawing of a context menu assigned to a tray icon - but
I was hoping someone could advise me as to how...
|
by: boxim |
last post by:
hi all,
i need to develop a control to show contact details for companies, in a
similar fashion to the way outlook shows contacts.
at the moment, i'm cheating using HTML fed from a web server,...
|
by: Eric |
last post by:
I implemented owner drawing on the main and context menus of my main form.
It works fine.
There is also a notify icon control that has a context menu. When the icon
is in the status bar, it...
|
by: Patty O'Dors |
last post by:
Hi
I have some code to create an ownerdrawn listbox (derived), and when I add
an item to it, the bold text of the first item (the title, 'Collections and
Maturities') mysteriously seems to get...
|
by: dan heskett |
last post by:
I am owner-drawing a listbox, in an attempt to create a nice list with some
custom "fields" and text layout.
Essentially it works, but I must be missing something big, conceptually,
because I...
|
by: Brian Henry |
last post by:
Ok whats going on here... got a couple problems... this is relevant now to
this group since .NET 2.0 is finally RTM
1) draws really slow when making it a large form (resizing speed is jerky)
to...
|
by: Brian Henry |
last post by:
I cant seem to remember this one... I have a list view, and im owner drawing
the items, i dont want the selection to hide when it loses focus so i have
hideselection = false, but when i owner draw...
|
by: Steve Marshall |
last post by:
Hi All,
I'm working on an owner-drawn combo box which will display multiple
columns in the list, either from a table in an associated DataSourse or
from delimited strings in the Items...
|
by: LostInMd |
last post by:
Hi All,
I've got an owner drawn listBox where I draw and measure the items that I add
to the listBox. For example, I have a listBox that can only display 10
characters on each horizontal line. ...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: 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: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |