本帖最后由 zvallnote 于 2014-7-23 20:26 编辑
这样对吗。。不过我没起作用 没有绘制边框。但 MessageBox弹了设置了这个 也不起作用
Comb1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
[C#] 纯文本查看 复制代码 protected override void OnMouseEnter(EventArgs e)
{
_mouseEnter = true;
IntPtr hDC = IntPtr.Zero;
Graphics gdc = null;
hDC = Win32.GetWindowDC(this.Handle);
gdc = Graphics.FromHdc(hDC);
// gdc.DrawImage(Shared.MouseMoveDrawButton, new Rectangle(this.Width - 20, 3, 16, 16));
ControlPaint.DrawBorder(gdc, new Rectangle(0, 0, Width, Height), Color.DodgerBlue, ButtonBorderStyle.Solid);
//画坚线
ControlPaint.DrawBorder(gdc, new Rectangle(Width - Height, 0, Height, Height), Color.DodgerBlue, ButtonBorderStyle.Solid);
//g.DrawLine(new Pen(Brushes.Blue, 2), new PointF(this.Width - this.Height, 0), new PointF(this.Width - this.Height, this.Height));
Win32.ReleaseDC(this.Handle, hDC);
gdc.Dispose();
base.OnMouseEnter(e);
}
|