473,396 Members | 1,895 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.

DrawString - Drawing MenuItem Text with Underline Mnemonic?

Lex
I have a c# app that has a OwnerDrawn menu items.

Is there and easy way to use DrawString to draw the underline under
the mnemonic character?

BTW - I figured out how to detected if we should be showing the
underline or not from my draw method:

if ((e.State.Equals(DrawItemState.None)) ||
(e.State.Equals(DrawItemState.Selected)))
acceleratorOn = true;

Regards
Jul 21 '05 #1
1 2627
pass a StringFormat (with HotkeyPrefix set to Show) to the DrawString
method.

--
Mick Doherty
http://homepage.ntlworld.com/mdaudi1...nate/home.html
"Lex" <de**@homerlex.mailshell.com> wrote in message
news:c5*************************@posting.google.co m...
I have a c# app that has a OwnerDrawn menu items.

Is there and easy way to use DrawString to draw the underline under
the mnemonic character?

BTW - I figured out how to detected if we should be showing the
underline or not from my draw method:

if ((e.State.Equals(DrawItemState.None)) ||
(e.State.Equals(DrawItemState.Selected)))
acceleratorOn = true;

Regards

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004
Jul 21 '05 #2

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

Similar topics

10
by: Lex | last post by:
I am writing a C# app that has a Menu. Some of the menu items will have short cuts that do not exist in the Shortcut enum. I would like the custom shortcuts to appear on the menu but as far as I...
2
by: Mark Keats | last post by:
Hi there, I have some code for an ASP.Net page that produces an image of an e-mail address to prevent those programs that spider the net for e-mail addresses on pages grabbing it. The code is...
1
by: Drew | last post by:
I posted this to framework.drawing, but did not get any responses... Maybe here?? I am drawing some text using DrawString() and using a bounding rectangle so that when the string is too long it...
1
by: Lex | last post by:
I have a c# app that has a OwnerDrawn menu items. Is there and easy way to use DrawString to draw the underline under the mnemonic character? BTW - I figured out how to detected if we should...
0
by: Valerie Hough | last post by:
I have derived a class from MenuItem so that I can associate IDs of my choosing with each item (a la C++). I have created a ContextMenu in the constructor of an owner draw list box and added a...
0
by: kate sporks | last post by:
I apologize if this double posts. I'm currently building a document viewer that uses DrawString(...) to render text. I've gotten it working quite well, including getting MeasureString and...
5
by: jack | last post by:
In using GDI+ drawstring, if the string to be drawn is in rtf format, how do I make GDI+ to recognize the rtf attributes. In other words, how do I draw one string in GDI+ , within which the...
0
by: Hasim AH | last post by:
Hi .. Just getting interested to learn C# and needs help. I want to write C# application so that the program will execute and draw graphics when the user select the drawing menu from the main...
2
by: Siv | last post by:
Hi, I want to print using the Graphics.Drawstring method but instead of using either bold or underline I want to combine both so the printed text is bold and underline?? The way I send the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
0
BarryA
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...
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
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
Oralloy
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,...
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
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.