Change the shape of a textbox control.

Hi, i'm new here and this will be my first question. I have seen this asked on many forums and it seems know one can come up with a solution, yet i know it's possible because it's available to buy as a control library from SickWin. I liked the look of it and attempted to replicate the effect, but without luck. Now it's become a mission for me!!! I have done much with the textbox control, even managed to create one that can support transparent backcolors, however i can't work out how i could change it's shape. To start with all i want to be able to do is give it round corners. Sounds simple, but it turns out the .net textbox is just a thin wrapper around the old win32 textbox and is not easily customizable. So has anyone implemented this before, and if so would they be kind enough to point me in the right direction.

Thanks.
Vis781Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wguerramCommented:
'You can take the idea with this code.

<Description("Returns a window handler."), _
        DllImport("user32.dll", _
        SetLastError:=True, CharSet:=CharSet.Auto, ExactSpelling:=True, _
        CallingConvention:=CallingConvention.StdCall)> _
        Public Shared Function GetWindowDC(ByVal hWnd As IntPtr) As IntPtr
        End Function

        <Description("frees a window handler."), _
        DllImport("user32.dll", _
        SetLastError:=True, CharSet:=CharSet.Auto, ExactSpelling:=True, _
        CallingConvention:=CallingConvention.StdCall)> _
        Public Shared Function ReleaseDC(ByVal hWnd As IntPtr, ByVal hDC As IntPtr) As Integer
        End Function

Public Class FlatTextBox
   Public Sub New()
        SetStyle(Windows.Forms.ControlStyles.DoubleBuffer, True)
   end sub

   Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
        Select Case m.Msg            
            Case APIConst.WndMsg.WM_PAINT
                MyBase.WndProc(m)

                Dim hDC As IntPtr = GetWindowDC(m.HWnd)
                Dim gdc As Drawing.Graphics = Drawing.Graphics.FromHdc(hDC)

               'Draw using this variable, search on the help, about the graphics class

               ReleaseDC(m.HWnd, hDC)
            Case Else
                MyBase.WndProc(m)
        End Select
    End Sub
end class
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.