473,396 Members | 1,927 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,396 software developers and data experts.

Creating DrawItemEventArgs for MenuItem

Tom
Hi

I am trying to force a drawitem for an owner drawn menuitem. As the
menuitem has no invalidate method i thought that i could just call the
overriden drawitem method, this need a DrawItemEventArgs parameter,
which i cannot create for the MenuItem. Anyone know how to force it?

I can create it using the CreateGraphics property of the parent
control, however this redraws the menuitem on the parent control
rather than the menu item... not so good:

Thanks

Tom
Nov 20 '05 #1
1 2009
Hi Tom,

Look at the work-around section of the following article for the code snippet
in C# to create a new DrawItemEventArgs object.

834530 BUG: The DrawItemEventArgs object returns incorrect ForeColor and
http://support.microsoft.com/?id=834530

You can follow the same logic in VB .net.

Hope this helps!
Bharat Patel
Microsoft, Visual Basic .NET

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.

Nov 20 '05 #2

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

Similar topics

1
by: Stuart Ferguson | last post by:
Hi All, I am currently writing an application in C# that uses dynamic menus that are created from a Database table. The problem I have is that i need a property in the MenuItem to store the DB...
0
by: Peder Y | last post by:
How can I set e.DrawFocusRectangle() correct in an owerdrawn multiselect listbox? I do all my drawing (e.g. OnMouseMove) calling OnDrawItem and constructing the DrawItemEventArgs. The problem is...
6
by: Claus Holm | last post by:
I'm trying to enable a menuitem in the parent form from a mdichild. Rather than making the menuitems public, I'd go for a public method in the parent form to do the change, but when I call the...
4
by: Ray Cassick \(Home\) | last post by:
I am in a bit of a bind. I can't believe I cannot figure this out but I have been at it all day and it is just not coming to me. I am building menus on a form based upon an XML file. I have...
6
by: Eric Sabine | last post by:
Basically, the following code creates a menuItem array and tries to use it twice. In the following piece of code, only the line that appears second gets used. The first becomes ignored presumably...
4
by: Jeff Mason | last post by:
I have an application where I need to set certain menu items invisible based on a user privilege. We did a sinmlar thing in VB6 and used the menu item's tag property to assign an identifier to...
2
by: polocar | last post by:
Hi, I'm writing a program using Visual C# 2005 Professional Edition, and I was trying to assign multiple MainMenu objects (one by one, of course) to the same Form (let's suppose 2 MainMenu...
2
by: csgraham74 | last post by:
Hi there, just wondering if someone could help me. Ive written some code in vb.net to create the following xml. <menu> <menuItem> <text>Political Update</text> </menuItem> <subMenu />
0
by: .nu | last post by:
#!/usr/bin/env python # -*- coding: utf-8 -*- # Name: Sleepy Hollow # Author: .nu import wx import os import sys
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
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,...
0
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...
0
jinu1996
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...
0
tracyyun
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...
0
agi2029
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 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.