Any Framework routines available for drawing text with accelerator

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Are there any .Net Framework routines available for drawing text with
accelerator keys in it for use when drawing UserControls.

I looked in ControlPaint and I cannot see any?

Also are they any built in routines for converting between a string or
character and a Keys Enumeration value?

How do you handle accelerator keys on your own user controls??

Thanks for any nudges in the right direction...
 
Thanks to Petzold I have part of my answer... Using the
StringFormat.HotkeyPrefix
property...

Still figuring out how to converty Keys to Accelerator keys

public void Draw(Graphics g,Control control)
{
Brush brush = new SolidBrush(control.ForeColor);
StringFormat stringFormat = new
StringFormat(StringFormatFlags.DisplayFormatControl);
stringFormat.HotkeyPrefix = HotkeyPrefix.Show;
g.DrawString(Text,control.Font,brush,4,4,stringFormat);
brush.Dispose();
}
 
Back
Top