How to Draw a Rounded Rectangle with WinForms (.NET)?

后端 未结 6 1873
时光说笑
时光说笑 2020-11-29 05:08

Draw rectangle using C# and I need to draw the arc in every edges first of all I draw rectangle and then I need click button it will draw the arc at edges, how can I do it?<

6条回答
  •  半阙折子戏
    2020-11-29 05:20

    Everything above works for drawing but if you want to convert your graphics path to custom control's region i think you should use CreateRoundRectRgn function (from gdi32) for proper curve for top right, bottom left and bottom right edges (top left edge has been drawn correctly according to radius). Take a quick look at http://pages.citebite.com/e1u2t5b7t4bih (site from instanceofTom's answer)

提交回复
热议问题