A
A
Alexander Prokopenko2022-01-26 04:48:29
C++ / C#
Alexander Prokopenko, 2022-01-26 04:48:29

How to add round stroke in C# win forms?

I make the button round with this code:

GraphicsPath myPath = new GraphicsPath();
myPath.AddEllipse(0, 0, button12.Width, button12.Height);

Region myRegion = new Region(myPath);
button12.Region = myRegion;


But when I add a stroke to the button, it makes sense that the stroke is square, and because of this, the round button gets strange lines instead of a stroke. How can I add a round stroke? Preferably without 2 elements that will be in the background of the button

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HemulGM, 2022-01-26
@AlexanderProkopenko

Regions - no matter how.
The region clips the final display of the button.
Round buttons don't do that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question