Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7944275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:30:16+00:00 2026-06-04T00:30:16+00:00

How to create curved edges of the textbox in winform c# Sample TextBox: http://www.codeproject.com/KB/edit/RoundedCornerTextbox/RoundedTextbox.png

  • 0

How to create curved edges of the textbox in winform c#

Sample TextBox:
http://www.codeproject.com/KB/edit/RoundedCornerTextbox/RoundedTextbox.png

This code VB

 Protected Overrides Function ProcessCmdKey(ByRef msg _
                    As System.Windows.Forms.Message, _
                    ByVal keyData As System.Windows.Forms.Keys) As Boolean 
    If msg.WParam.ToInt32() = CInt(Keys.Enter) Then 
        SendKeys.Send("{Tab}")
        Return True 
    ElseIf msg.WParam.ToInt32() = CInt(Keys.Decimal) Then 
        SendKeys.Send(",")
        Return True 
    End If 
End Function

The next method is the actual overriding of the WM_Paint event, in which the redrawing is done. It makes uses of the API functions GetWindowDC and ReleaseDC to get the actual graphics of the control, including the non-client area.

Protected Overrides Sub WndProc(ByRef m As _
          System.Windows.Forms.Message) Handles MyBase.WndProc(m)
    Select Case m.Msg
        Case &HF 'WM_PAINT 
            Dim rect As New Rectangle(0, 0, MyBase.Width, MyBase.Height)
            Dim hDC As IntPtr = GetWindowDC(Me.Handle)
            Dim g As Graphics = Graphics.FromHdc(hDC)
            If Me.Enabled Then 
                g.Clear(Color.White)
            Else 
                g.Clear(Color.FromName("control"))
            End If 
            DrawBorder(g)
            DrawText(g)
            ReleaseDC(Me.Handle, hDC)
            g.Dispose()
        Case &H7, &H8, &H200, &H2A3
        'CMB_DROPDOWN, CMB_CLOSEUP, WM_SETFOCUS, 
        'WM_KILLFOCUS, WM_MOUSEMOVE, 'WM_MOUSELEAVE 
            UpdateState()
    End Select 
End Sub

To get the rounded corners, the method shown below is used.

Private Sub TekenRondeRechthoek(ByVal g As Graphics, _
            ByVal pen As Pen, ByVal rectangle As Rectangle, _
            ByVal radius As Single)
    Dim size As Single = (radius * 2.0!)
    Dim gp As GraphicsPath = New GraphicsPath
    gp.AddArc(rectangle.X, rectangle.Y, size, size, 180, 90)
    gp.AddArc((rectangle.X + (rectangle.Width - size)), _
               rectangle.Y, size, size, 270, 90)
    gp.AddArc((rectangle.X + (rectangle.Width - size)), _
              (rectangle.Y + (rectangle.Height - size)), _
              size, size, 0, 90)
    gp.AddArc(rectangle.X, (rectangle.Y + _
             (rectangle.Height - size)), size, size, 90, 90)
    gp.CloseFigure()
    g.DrawPath(pen, gp)
    gp.Dispose()
End Sub

How to create in c#

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:30:18+00:00Added an answer on June 4, 2026 at 12:30 am

    http://www.developerfusion.com/tools/convert/vb-to-csharp/ is an excellent site to convert VB.net code to C# (or the other way around). Should make it easier for you to do the alterations and see how it does it in VB.net

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read some tutorials for bezier curve such as this one http://www.codeproject.com/KB/recipes/BezirCurves.aspx .
I am framing ads with a curved border. Here is a sample ad: http://imageshack.us/f/20/4e5f5fe94b327new60seciq.png/
My goal is to create a curved arrow like this one, on an html5
Is it possible to create the curved sail shape below using HTML and CSS
create table ImagenesUsuario { idImagen int primary key not null IDENTITY } This doesn't
Is it possible to create a curved box-shadow with CSS3? Below is an image
is it possible to create this image in PHP using GD ? i know
I have written this package CREATE OR REPLACE PACKAGE CURVES AS type t_forecast_values is
I hope this is just a learning curve I'm going through. I create an
I'm looking to create text follow a curved arch. How can I go about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.