Is there a way to create a line separator using a Label object in C #?

I am using VS 2010.

Is there a way to make a line separator in C # Windows Forms? I sometimes use the default background color and the overall white background.

Both of these methods that I found do not work for me.

label2.AutoSize = false; label2.Height = 2; label2.BorderStyle = BorderStyle.Fixed3D; 

or

  label2.MaximumSize = new Size(100, 0); label2.AutoSize = true; 
+4
source share
1 answer

Just change the first to use BorderStyle.FixedSingle or change the height to at least 4 .

WinForms is not much new, but VS should come with Power Pack Power Controls. If you see this section on the toolbar, there is an available line control that you can leave on your designer. You can change the style, thickness, color, etc.

+3
source

Source: https://habr.com/ru/post/1495447/