none
C# Create a button with rounded corners

    Question

  • Hello,

    i need some help with creating a button with rounded corners.

    I use VisualStudio 2010, C# WindowsForms.

    Could somebody help me please

    Thanks
    user2828646

    Monday, September 30, 2013 11:34 AM

Answers

  • Hi user2828646,

    I think you've got the code to create a button with cornors. The most interest code should be the OnPaint event which enables you draw the button by yourself.

    If you have no idea how it implement with your existing code, try to copy others' sample directly into your project and modify the code to learn it then get what you want.

    Please start your coding and let us know your specific questions by submiting new question in the forum.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    Alan Yao
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, October 03, 2013 7:00 AM

All replies

  • Hello,

    For create a round corner button, please have a look at this blog:

    http://www.codeproject.com/Articles/15730/RoundButton-Windows-Control-Ever-Decreasing-Circle

    or this thread http://social.msdn.microsoft.com/Forums/windows/en-US/ebe64711-d63b-446f-acf4-db4abc35ddb3/rounded-button-windows-form-c 

    Regards,


    Barry Wang
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, October 01, 2013 8:26 AM
  • Thank you for your answer but i dont know what i can do with this lines of code...

    For example this link: http://dotnetrix.co.uk/button.htm

    There is a lot of code and i have no idea what i can do with this code or how i implement my button to this code.

    Can you help me please

    regards
    user2828646

    Tuesday, October 01, 2013 9:03 AM
  • Hi user2828646,

    I think you've got the code to create a button with cornors. The most interest code should be the OnPaint event which enables you draw the button by yourself.

    If you have no idea how it implement with your existing code, try to copy others' sample directly into your project and modify the code to learn it then get what you want.

    Please start your coding and let us know your specific questions by submiting new question in the forum.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    Alan Yao
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, October 03, 2013 7:00 AM
  • Thank you for your answer but i dont know what i can do with this lines of code...

    For example this link: http://dotnetrix.co.uk/button.htm

    There is a lot of code and i have no idea what i can do with this code or how i implement my button to this code.

    Can you help me please

    regards
    user2828646

    For my examples just add a new class to your project, copy and paste the code to the class, rebuild your project and you will see an automagically created button on the top of your toolbox which you can add to your form just like any other control ;)


    Mick Doherty
    http://dotnetrix.co.uk
    http://glassui.codeplex.com

    Thursday, October 03, 2013 5:45 PM