protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e)
{
Graphics g = e.Graphics;
Rectangle rect = e.AffectedBounds;
g.SmoothingMode = SmoothingMode.HighQuality;
int Rgn = NativeMethods.CreateRoundRectRgn(1, 1, rect.Width, rect.Height, 2, 2);
NativeMethods.SetWindowRgn(e.ToolStrip.Handle, Rgn, true);
Image bgk = AssemblyHelper.GetImage("QQ.ContextMenu.menu_bkg.png");
Image board = AssemblyHelper.GetImage("QQ.ContextMenu.menu_bkg_board.png");
g.DrawImage(bgk, new Rectangle(0, 0, 28, 5), new Rectangle(4, 4, 28, 5), GraphicsUnit.Pixel);//左上角
g.DrawImage(bgk, new Rectangle(0, 5, 28, rect.Height - 10), new Rectangle(4, 8, bgk.Height - 2, 14), GraphicsUnit.Pixel);//左边
g.DrawImage(bgk, new Rectangle(0, rect.Height - 5, 28, 5), new Rectangle(4, bgk.Height - 9, 28, 5), GraphicsUnit.Pixel);//左下角
//右侧
g.DrawImage(board, new Rectangle(28, 0, rect.Width - 32, 5), new Rectangle(10, 4, board.Width - 35, 5), GraphicsUnit.Pixel);//上边
g.DrawImage(board, new Rectangle(rect.Width - 4, 0, 8, 5), new Rectangle(board.Width - 8, 4, 8, 5), GraphicsUnit.Pixel);//右上角
g.DrawImage(board, new Rectangle(rect.Width - 4, 5, 8, rect.Height - 10), new Rectangle(board.Width - 8, 10, 8, 12), GraphicsUnit.Pixel);//右边
g.DrawImage(board, new Rectangle(rect.Width - 4, rect.Height - 5, 8, 5), new Rectangle(board.Width - 8, board.Height - 9, 8, 5), GraphicsUnit.Pixel);//右下角
g.DrawImage(board, new Rectangle(28, rect.Height - 4, rect.Width - 32, 5), new Rectangle(10, board.Height - 8, board.Width - 35, 5), GraphicsUnit.Pixel);//下边
g.DrawImage(board, new Rectangle(28, 5, rect.Width - 32, rect.Height - 9), new Rectangle(10, 10, 32, 12), GraphicsUnit.Pixel);//填充
base.OnRenderToolStripBackground(e);
}