473,756 Members | 2,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Equal s(DrawItemState .None)) ||
(e.State.Equals (DrawItemState. Selected)))
acceleratorOn = true;

Regards
Jul 21 '05 #1
1 2663
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.goog le.com...
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.Equal s(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
2581
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 can tell there is no way to add a short cut that is not in the Shortcut enum. I have my on keyboard hook so I am not worried about the custom shortcut magically working. I just want it to appear nicely formated on the menu. Anyone have any...
2
14874
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 as follows (but on my version it gets the e-mail address from a database rather than QueryString). How can I crop the image to the exact size of the text as if the e-mail
1
8843
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 wraps automatically. I want to decrease the amount of space between the lines. How would I go about changing the LineSpacing? The FontFamily has a read only property. Any ideas?
1
2942
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 be showing the underline or not from my draw method: if ((e.State.Equals(DrawItemState.None)) || (e.State.Equals(DrawItemState.Selected)))
0
1719
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 number of MyMenuItems to it, each with a unique mnemonic (&Item1 e.g.). When I right click the mouse on my list box, all the menus show up as intended; the characters I have assigned as mnemonics work, but the mnemonic character is not...
0
1285
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 StringFormat.GenericTypographic. However, I run into a problem when I have to print a string consisting purely of whitespace. This problem only occurs when it's a collection of spaces, like " ", and the Font says to underline it. If there's...
5
5035
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 font size , bold / underline attributes are different.
0
3556
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 menu, SigDraw. Here is the codes:- using System; using System.Drawing; using System.Collections;
2
14950
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 drawstring command is as follows: Somewhere in my declarations I have: Private ra As System.Drawing.StringFormat
0
9275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9872
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.