none
Rounded corner textbox in Windows Forms

    Question

  • Hi,

       Is any one have any idea about how to create rounded corner TextBox in Winforms ..???

     

    Thanks

    • Moved by SamAgain Wednesday, April 14, 2010 3:58 AM better fit (From:.NET Base Class Library)
    Tuesday, April 13, 2010 12:42 PM

Answers

  • Hi Dheeraj,

    This link will help you: Textbox with rounded corners

    Best Wishes,
    Helen Zhou


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Helen Zhou Monday, April 19, 2010 3:44 AM
    Thursday, April 15, 2010 2:55 AM

All replies

  • It is tricky to redraw the border of a textbox.  You can override the message pump and trap the non-client paint message.  At that point you can draw the border yourself.  Are you using VB or C#?
    jon.stromer.galley
    • Proposed as answer by mirvel Tuesday, April 16, 2013 10:57 PM
    Tuesday, April 13, 2010 3:19 PM
  • Hi,

        Thanks to reply my question,Here i am using C#..

    Could you please post sample code..? So i can easily catch up.

     

    Thanks

    Wednesday, April 14, 2010 5:09 AM
  • Hi,

        Thanks to reply my question,Here i am using C#..

    Could you please post sample code..? So i can easily catch up.

     

    Thanks

    Wednesday, April 14, 2010 5:09 AM
  • A much easier way would be to create a UserControl. Put a regular TextBox in the middle and set its border style to None. Make sure there is enough room around the edges of the UserControl to fit a border. Then override UserControl.OnPaint and draw the border yourself.
    Wednesday, April 14, 2010 3:23 PM
  • Hi Dheeraj,

    This link will help you: Textbox with rounded corners

    Best Wishes,
    Helen Zhou


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Helen Zhou Monday, April 19, 2010 3:44 AM
    Thursday, April 15, 2010 2:55 AM