How To Change TextBox Border Color In C#

Uncategorized Comments Off

private static int WM_NCPAINT = 0×0085;
private static int WM_ERASEBKGND = 0×0014;
private static int WM_PAINT = 0×000F;

[DllImport(“user32.dll”)]
static extern IntPtr GetDCEx(IntPtr hwnd, IntPtr hrgnclip, uint fdwOptions);
DllImport(“user32.dll”)]
static extern int ReleaseDC(IntPtr hwnd, IntPtr hDC);

protected override void WndProc(ref Message m)

{

    base.WndProc(ref m);

    if (m.Msg == WM_NCPAINT || m.Msg == WM_ERASEBKGND || m.Msg == WM_PAINT)

    {

        IntPtr hdc = GetDCEx(m.HWnd, (IntPtr)1, 1 | 0×0020);

        if (hdc != IntPtr.Zero)

        {

            Graphics graphics = Graphics.FromHdc(hdc);

            Color borderColor = Color.Blue;

            Rectangle rectangle = new Rectangle(0, 0, this.Width, this.Height);

            ControlPaint.DrawBorder(graphics, rectangle, borderColor, ButtonBorderStyle.Solid);

            m.Result = (IntPtr)1;

            ReleaseDC(m.HWnd, hdc);

        }

    }

}

8 Websites Every Microsoft .NET Developer Should Know About…

Uncategorized Comments Off

There are currently millions of developers worldwide that are using Microsoft.NET technologies. If you are one of them or want to become one, then each of the websites I am about to list should be in your list of favorites, your list of bookmarks, or just written down on a piece of paper (yeah right, as if a .NET developer would use a pen and paper). Read the rest of this entry »

Emir Images

Uncategorized No Comments »

dfg

Uncategorized No Comments »

dsfgdsfgsdgf

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login