473,322 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Ownerdraw menuItem

I use the ownerdraw methode to customize my menu.

So, inside the sub OnDrawItem I need to know the size of my form

Do you have any idea to do that.

I dont want to use the reference to the name of my Form because I use
a class and I wish to use it with any name.
Thanks in advance
Nov 20 '05 #1
2 1013
Michel,
I use the ownerdraw methode to customize my menu.

So, inside the sub OnDrawItem I need to know the size of my form

Do you have any idea to do that.


Dim main As MainMenu = Me.GetMainMenu()
If Not main Is Nothing Then
theSize = main.GetForm().Size
End If

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 20 '05 #2
Wonderfull. Exactly what I want. Thanks Mattias

"Mattias Sjögren" <ma********************@mvps.org> a écrit dans le message
de news: OP*************@tk2msftngp13.phx.gbl...
Michel,
I use the ownerdraw methode to customize my menu.

So, inside the sub OnDrawItem I need to know the size of my form

Do you have any idea to do that.


Dim main As MainMenu = Me.GetMainMenu()
If Not main Is Nothing Then
theSize = main.GetForm().Size
End If

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: MstrControl | last post by:
Greetings All, A few months ago I've come across an Owner Drawn Menu that placed the items side by side instead one under another. Now I need something like this but I can't rememeber where I...
5
by: Rob Mayo | last post by:
How can I force a MeasureItem message for an owner-dramn menu item? Here is the dilemma. I wrote a lovely little Component for owner-drawing all the menus on a form and making them look like...
0
by: Apollo440 | last post by:
If MenuItem.OwnerDraw Property is true,.NET framework does not recognize the overlapped accelerator keys. Is there a workaround? eg) +------+ |&Test | <- |&Tea | <- MenuItems has...
2
by: Stuart Norris | last post by:
Dear Group, I am new to c# and windows form designer - coming from a Motif background. I am attempting to develop an application for a touch screen and I need to have a menu system with a...
2
by: jm | last post by:
There are properties for OwnerDraw on ContextMenu items. I know it can be done with regular menus. I cannot find anyone doing it with the systray icon contextmenu (notifyicon.) Is it possible to...
0
by: Peter Proost | last post by:
Hi group, I was wondering if anyone has ever done this before, I've got a working ownerdrawn menu the only thing I can't get to work is to ownerdraw the items the get automaticaly created in a...
2
by: Peter Proost | last post by:
Hi group, I've got this ownerdraw menu module which I got from a site and modified to my personal needs, but the only problem I'm having is with the lines in a menu, when you type - as text, it...
2
by: Peter Proost | last post by:
Hi, I've got the following ownerdraw menu: drag a mainmenu on a form and add some menuitems to it, set all the menuitems to ownerdraw = true and for every menuitem add this code (replace...
0
by: genojoe | last post by:
This code is derived from: ms-help://MS.VSCC.2003/MS.MSDNQTR.2005JUL.1033/cpref/html/frlrfSystemWindowsFormsMenuItemClassOwnerDrawTopic.htm The sample works as presented but does not contain a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.