📄 linzl.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace lzl061111152357good5
{
/// <summary>
/// drawmune 的摘要说明。
/// </summary>
///
public class linzl
{
//public string MyString;
//public float x;
//public float y;
public void MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e,int x,int y)
{//设置菜单项"显示名车图片"的显示区域
e.ItemHeight=x;
e.ItemWidth=y;
}
public void DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e,string MyString,float x,float y,Color c1,Color c2,Color c3,Color c4)
{//绘制第一个菜单
Graphics g=e.Graphics;
//判断菜单的状态
if((e.State&DrawItemState.Selected)==DrawItemState.Selected)
{//当菜单被先选中时
//绘制背景填充矩形
g.FillRectangle(new SolidBrush(c1),e.Bounds.Left-74,e.Bounds.Top,e.Bounds.Width,e.Bounds.Height);
//绘制菜单项标题
//this.MyString=MyString ;
Font MyFont = new Font("宋体", 9,FontStyle.Regular);
SolidBrush MyBrush = new SolidBrush(c2);
//this.x= x ;
//this.y= y ;
StringFormat MyFormat = new StringFormat();
MyFormat.FormatFlags = StringFormatFlags.NoWrap;
e.Graphics.DrawString(MyString, MyFont, MyBrush, x, y, MyFormat);
}
else
{//当菜单未被先选中时
//绘制背景填充矩形
g.FillRectangle(new SolidBrush(c3),e.Bounds.Left-74,e.Bounds.Top,e.Bounds.Width,e.Bounds.Height);
//绘制菜单标题
//String MyString = " 帮助";
Font MyFont = new Font("宋体", 9,FontStyle.Regular);
SolidBrush MyBrush = new SolidBrush(c4);
//float x = 10.0F;
//float y = 10.0F;
StringFormat MyFormat = new StringFormat();
MyFormat.FormatFlags = StringFormatFlags.NoWrap;
e.Graphics.DrawString(MyString, MyFont, MyBrush, x, y, MyFormat);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -