|
[DllImport ("User32.dll")]
private static extern IntPtr GetWindowDC (IntPtr hwnd);
[DllImport ("User32.dll")]
private static extern int ReleaseDC (IntPtr hwnd, IntPtr hdc);
[DllImport ("Kernel32.dll")]
private static extern int GetLastError ();
protected override void WndProc (ref Message m)
{
base.WndProc (ref m);
switch (m.Msg)
{
case 0x86: // WM_NCACTIVATE
goto case 0x85;
case 0x85: // WM_NCPAINT
{
IntPtr hDC = GetWindowDC (m.HWnd);
Graphics gs = Graphics.FromHdc (hDC);
Rectangle m_rect = new Rectangle (0, 0, 300, 300);
gs.FillRectangle (new LinearGradientBrush (m_ret, Color.Pink, Color.Pink, LinearGradientMode.BackwardDiagonal), m_rect);
StringFormat strFmt = new StringFormat ();
strFmt.Alignment = StringAlignment.Center;
strFmt.LineAlignment = StringAlignment.Center;
gs.DrawString ("√", this.Font, Brushes.BlanchedAlmond, m_rect, strFmt);
gs.Dispose ();
// Release GDI resources
ReleaseDC (m.HWnd, hDC);
break;
}
}
My code is probably like this. . You can try it out. I just want to get rid of the original colors. . . . |
|