Draw String's Hotkey : Hotkey : Drawing 2D C# Examples


C# Examples » Drawing 2D » Hotkey »

 

Draw String's Hotkey








    
using  System;
using  System.Drawing;
using  System.Windows.Forms;
using  System.Drawing.Text;        //    necessary  for  HotkeyPrefix

public  class  DrawStringHotkey  :  Form
{
    public  DrawStringHotkey()
    {
        ResizeRedraw  =  true;

    }

    protected  override  void  OnPaint(PaintEventArgs  e)
    {
        base.OnPaint(e);
        Graphics  g  =  e.Graphics;
        StringFormat  fmt  =  new  StringFormat();
        fmt.Alignment  =  StringAlignment.Center;
        fmt.HotkeyPrefix  =  HotkeyPrefix.Show;

        Brush  b  =  new  SolidBrush(ForeColor);
        g.DrawString("&Do  It!",  Font,  b,  ClientSize.Width  /  2,  50,  fmt);
    }

    static  void  Main()  
    {
        Application.Run(new  DrawStringHotkey());
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Drawing 2D
» Hotkey