1.用Windows API(费事、效果不好)
2.强烈推荐用Active Bar2.0 SP3(XP风格、功能强大。想要的话留下Mail)
3.用其它控件。

解决方案 »

  1.   

    用menuitem的drawitem,自己定义。
      

  2.   

    把相应的menu item的owner draw设为true,然后在draw item事件中,load image,再draw caption。
      

  3.   

    欢迎访问下面这个地址,可以下载源码,我写的
    http://www30.brinkster.com/zhaixd/column.asp?includeurl=source/code.asp
      

  4.   

    感谢您使用微软产品。在C#中,您可以通过自己绘制菜单项的方式来定制菜单。
    首先,需设置该菜单项,如menuItemExit菜单项的OwnerDraw属性为true;
    然后,需要处理menuItemExit菜单项的MeasureItem事件的响应方法menuItemExit_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e)和该菜单项的DrawItem事件的响应方法private void menuItemExit_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)。
    其中:
    MeasureItem:用于设置菜单项的高度和宽度;
    DrawItem:用来绘制实际的菜单项,包括图标,文本等等。
    下面提供一段示例代码,用来实现加图标exit.bmp的菜单项menuItemExit,可供您参考:
    private void menuItemExit_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e)
    {
    e.ItemHeight = 25;
    e.ItemWidth = 75;
    }private void menuItemExit_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
    {
    Rectangle rc = new Rectangle(e.Bounds.X,e.Bounds.Y,e.Bounds.Width,e.Bounds.Height);
    e.Graphics.FillRectangle(new SolidBrush(Color.White),rc);
    MenuItem s = (MenuItem)sender;
    string strItem = s.Text;
    StringFormat sf = new StringFormat();
    sf.Alignment = StringAlignment.Far;
    sf.LineAlignment = StringAlignment.Center;
    e.Graphics.DrawString(strItem,new Font("Veranda",10), new SolidBrush(Color.Blue),rc,sf);
    e.Graphics.DrawRectangle(new Pen(new SolidBrush(Color.White)),rc);
    if(e.State ==(DrawItemState.NoAccelerator | DrawItemState.Selected))
    {
    e.Graphics.FillRectangle(new SolidBrush(Color.CornflowerBlue),rc);
    e.Graphics.DrawString(strItem,new Font("Veranda",10,FontStyle.Bold|FontStyle.Underline),new SolidBrush(Color.Yellow),rc,sf);
    e.Graphics.DrawRectangle(new Pen(new SolidBrush(Color.Blue)),rc);
    //Draws a focus rectangle within the bounds specified in the DrawItemEventArgs constructor.
    e.DrawFocusRectangle();
    } Image imgExit = new Bitmap("exit.bmp");
    SizeF sz = imgExit.PhysicalDimension ;
    e.Graphics.DrawImage(imgExit,e.Bounds.X + 5,(e.Bounds.Bottom + e.Bounds.Top)/2 - sz.Height/2);
    }
     — 微软全球技术中心 VB支持中心本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
    为了为您创建更好的讨论环境,请参加我们的用户满意度调查(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。