给个mail地址我,给你那儿发个demo.

解决方案 »

  1.   

    我也想要,thanks
    [email protected]
      

  2.   

    我的Email:[email protected]我想要一个.net风格的菜单,谢谢~!!!
      

  3.   

    my email: [email protected] give me a copy too. Thanks.
      

  4.   

    [email protected]
    Thanks lots!!!
      

  5.   

    给我一份研究一下,多谢!
    [email protected]
      

  6.   

    请也帮我发一份,谢谢了!
    [email protected]
      

  7.   

    发出去了。to dy630(半导体)的信被退了,不解。
      

  8.   

    my email: [email protected] give me a copy too. Thanks
    Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!
      

  9.   

    我也要
       email: [email protected]
      

  10.   

    顺便给我一个吧!
    [email protected]
    谢谢!
      

  11.   

    给我一个吧
    [email protected] you!!
      

  12.   

    也麻烦发一份给我吧,我挂到网上去,免得你忙不过来[email protected]
      

  13.   

    老大,给我一份。
    [email protected]
      

  14.   

    thank you!        [email protected]
      

  15.   

    More Thanks!!! send me a copy -- [email protected]
      

  16.   

    这是C#SharpDevelop的部分源代码,实现了两种菜单风格://  RichMenuItem.cs
    //  Copyright (c) 2001 Mike Krueger
    //
    //  This program is free software; you can redistribute it and/or modify
    //  it under the terms of the GNU General Public License as published by
    //  the Free Software Foundation; either version 2 of the License, or
    //  (at your option) any later version.
    //
    //  This program is distributed in the hope that it will be useful,
    //  but WITHOUT ANY WARRANTY; without even the implied warranty of
    //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    //  GNU General Public License for more details.
    //
    //  You should have received a copy of the GNU General Public License
    //  along with this program; if not, write to the Free Software
    //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USAusing System;
    using System.Drawing;
    using System.Diagnostics;
    using System.Drawing.Text;
    using System.Drawing.Imaging;
    using System.Windows.Forms;//using SharpDevelop.Gui.Window;
    //using Core.Properties;
    //using SharpDevelop.Internal.ExternalTool;
    //using Internal.Text;
      

  17.   

    namespace SharpDevelop.Gui.Components {

    public enum IconMenuStyle {
    Standard,
    Office2000,
    VSNet
    };

    public interface MenuItemStyleDrawer
    {
    void DrawCheck(Graphics g, Rectangle bounds, bool selected);
    void DrawIcon(Graphics g, Image icon, Rectangle bounds, bool selected, bool enabled, bool ischecked);
    void DrawSeparator(Graphics g, Rectangle bounds);
    void DrawBackground(Graphics g, Rectangle bounds, DrawItemState state, bool toplevel, bool hasicon);
    void DrawMenuText(Graphics g, Rectangle bounds, string text, string shortcut, bool enabled, bool toplevel, DrawItemState state);
    }

    public class Office2000Style : MenuItemStyleDrawer
    {
    static int TEXTSTART = 20;

    public void DrawCheck(Graphics g, Rectangle bounds, bool selected)
    {
    ControlPaint.DrawMenuGlyph(g, new Rectangle(bounds.X + 2, bounds.Y + 2, 14, 14), MenuGlyph.Check);
    }

    public void DrawIcon(Graphics g, Image icon, Rectangle bounds, bool selected, bool enabled, bool ischecked)
    {
        if (enabled) {
    g.DrawImage(icon, bounds.Left + 2, bounds.Top + 2);
        } else
         ControlPaint.DrawImageDisabled(g, icon, bounds.Left + 2, bounds.Top + 2, SystemColors.Control);
       
    if (selected)
         ControlPaint.DrawBorder3D(g, bounds.Left, bounds.Top, icon.Width + 3, icon.Height + 3, Border3DStyle.RaisedInner);
    }

    public void DrawSeparator(Graphics g, Rectangle bounds)
    {
    ControlPaint.DrawBorder3D(g, bounds.X, bounds.Y + 2, bounds.Width, 3, Border3DStyle.Etched, Border3DSide.Top);
    }

    public void DrawBackground(Graphics g, Rectangle bounds, DrawItemState state, bool toplevel, bool hasicon)
    {
    bool selected = (state & DrawItemState.Selected) > 0;
    if (selected ||((state & DrawItemState.HotLight) > 0)) {
    if (toplevel) {
    //      g.FillRectangle(SystemBrushes.Highlight, bounds);
         ControlPaint.DrawBorder3D(g, bounds.Left, bounds.Top, bounds.Width, bounds.Height, selected ? Border3DStyle.SunkenOuter : Border3DStyle.RaisedInner, Border3DSide.All);
    } else {
    if (hasicon) {
        g.FillRectangle(SystemBrushes.Menu, new Rectangle(bounds.X, bounds.Y, bounds.X + SystemInformation.SmallIconSize.Width + 5, bounds.Height));
    bounds.X += SystemInformation.SmallIconSize.Width + 5;
    bounds.Width -= SystemInformation.SmallIconSize.Width + 5;
    }
         g.FillRectangle(SystemBrushes.Highlight, bounds);
    }
    } else {
    if (toplevel) {
    g.FillRectangle(SystemBrushes.Control, bounds);
    } else {
    g.FillRectangle(SystemBrushes.Menu, bounds);
    }
    }
    }

    public void DrawMenuText(Graphics g, Rectangle bounds, string text, string shortcut, bool enabled, bool toplevel, DrawItemState state)
    {
    bool selected = (state & DrawItemState.Selected) > 0;
        StringFormat stringformat = new StringFormat();
    stringformat.HotkeyPrefix = ((state & DrawItemState.NoAccelerator) > 0) ? HotkeyPrefix.Hide : HotkeyPrefix.Show;
    int shortcutwidth = (int)(g.MeasureString(shortcut, SystemInformation.MenuFont).Width);
    int textwidth = (int)(g.MeasureString(text, SystemInformation.MenuFont).Width);
    int x = toplevel ? bounds.Left + (bounds.Width - textwidth) / 2: bounds.Left + TEXTSTART;

    int y = bounds.Top + 2;
    if (enabled) {
    // normal draw
    Color color  = (selected && !toplevel) ? Color.White : SystemColors.MenuText;
    g.DrawString(text, SystemInformation.MenuFont, new SolidBrush(color), x, y, stringformat);
    g.DrawString(shortcut, SystemInformation.MenuFont, new SolidBrush(color), bounds.Left + 130, bounds.Top + 2, stringformat);
    } else {
    // disabled menuitem draw
    if (!selected) {
    g.DrawString(text, SystemInformation.MenuFont, SystemBrushes.ControlLightLight, x + 1, y + 1, stringformat);
    g.DrawString(shortcut, SystemInformation.MenuFont, SystemBrushes.ControlLightLight, bounds.Right - shortcutwidth - 10 + 1, bounds.Top + 2 + 1, stringformat);

    g.DrawString(text, SystemInformation.MenuFont, new SolidBrush(SystemColors.GrayText), x, y, stringformat);
    g.DrawString(shortcut, SystemInformation.MenuFont, new SolidBrush(SystemColors.GrayText), bounds.Right - shortcutwidth - 10, bounds.Top + 2, stringformat);
    }
    }
    }
      

  18.   

    public class VSNetStyle : MenuItemStyleDrawer
    {
    static Color bgcolor  = SystemColors.ControlLightLight; //Color.FromArgb(246, 246, 246);
    static Color ibgcolor = SystemColors.ControlLight; //Color.FromArgb(202, 202, 202);

    static Color sbcolor  = Color.FromArgb(173, 173, 209);
    static Color sbbcolor = Color.FromArgb(  0,   0, 128);

    static int TEXTSTART = 20;

    public void DrawCheck(Graphics g, Rectangle bounds, bool selected)
    {
    ControlPaint.DrawMenuGlyph(g, new Rectangle(bounds.X + 2, bounds.Y + 2, 14, 14), MenuGlyph.Check);
    g.DrawRectangle(new Pen(sbbcolor), bounds.X + 1, bounds.Y + 1, 14 + 1, 14 + 1);
    }

    public void DrawIcon(Graphics g, Image icon, Rectangle bounds, bool selected, bool enabled, bool ischecked)
    {
         if (enabled) {
         if (selected) {
         ControlPaint.DrawImageDisabled(g, icon, bounds.Left + 2, bounds.Top + 2, Color.Black);
    g.DrawImage(icon, bounds.Left + 1, bounds.Top + 1);
         } else {
    g.DrawImage(icon, bounds.Left + 2, bounds.Top + 2);
         }
         } else
         ControlPaint.DrawImageDisabled(g, icon, bounds.Left + 2, bounds.Top + 2, SystemColors.HighlightText);
    }

    public void DrawSeparator(Graphics g, Rectangle bounds)
    {
    int y = bounds.Y + bounds.Height / 2;
    g.DrawLine(new Pen(SystemColors.ControlDark), bounds.X + SystemInformation.SmallIconSize.Width + 7, y, bounds.X + bounds.Width - 2, y);
    }

    public void DrawBackground(Graphics g, Rectangle bounds, DrawItemState state, bool toplevel, bool hasicon)
    {
    bool selected = (state & DrawItemState.Selected) > 0;

    if (selected || ((state & DrawItemState.HotLight) > 0)) {
    if (toplevel && selected) { // draw toplevel, selected menuitem
         g.FillRectangle(new SolidBrush(ibgcolor), bounds);
         ControlPaint.DrawBorder3D(g, bounds.Left, bounds.Top, bounds.Width, bounds.Height, Border3DStyle.Flat, Border3DSide.Top | Border3DSide.Left | Border3DSide.Right);
    } else { // draw menuitem, selected OR toplevel, hotlighted
         g.FillRectangle(new SolidBrush(sbcolor), bounds);
    g.DrawRectangle(new Pen(sbbcolor), bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1);
    }
    } else {
    if (!toplevel) { // draw menuitem, unselected
         g.FillRectangle(new SolidBrush(ibgcolor), bounds);
    bounds.X += 16 + 5;
    bounds.Width -= 16 + 5;
         g.FillRectangle(new SolidBrush(bgcolor), bounds);
    } else {
    // draw toplevel, unselected menuitem
    g.FillRectangle(SystemBrushes.Control, bounds);

    }
    }
    }

    public void DrawMenuText(Graphics g, Rectangle bounds, string text, string shortcut, bool enabled, bool toplevel, DrawItemState state)
    {
        StringFormat stringformat = new StringFormat();
    stringformat.HotkeyPrefix = ((state & DrawItemState.NoAccelerator) > 0) ? HotkeyPrefix.Hide : HotkeyPrefix.Show;
    int textwidth = (int)(g.MeasureString(text, SystemInformation.MenuFont).Width);
    int shortcutwidth = (int)(g.MeasureString(shortcut, SystemInformation.MenuFont).Width);

    int x = toplevel ? bounds.Left + (bounds.Width - textwidth) / 2: bounds.Left + TEXTSTART;
    int y = bounds.Top + 2;
    Brush brush = null;
    if (!enabled)
    brush = new SolidBrush(Color.FromArgb(120, SystemColors.MenuText));
    else
    brush = new SolidBrush(SystemColors.MenuText);
    g.DrawString(text, SystemInformation.MenuFont, brush, x, y, stringformat);

    g.DrawString(shortcut, SystemInformation.MenuFont, brush, bounds.Right - shortcutwidth - 10, bounds.Top + 2, stringformat);
    }
    }