Дали на практике задание с помощью user control написать квадратный прогресс бар в форме с анимацией,value в свойствах и все такое.Много думал,гуглил и спрашивал,так и не понял как я могу это сделать.
Сам котрол - UserControl Для отрисовки - перегрузи Paint Чтобы отрисовать обводку используй GraphicsPath, отрисовка прогресса думаю для тебя будет лёгкой Просто погугли примеры UserControl, там же и будет кастомное свойство --- Сообщение объединено с предыдущим 13 июл 2022 public static void Round(this Control control, int radius, bool topRight, bool topLeft, bool bottomLeft, bool bottomRight) { try { using (var path = new GraphicsPath()) { if (topRight) { path.AddLine(radius, 0, control.Width - radius, 0); path.AddArc(control.Width - radius, 0, radius, radius, 270, 90); } else path.AddLine(0, 0, control.Width, 0); if (bottomRight) { path.AddLine(control.Width, radius, control.Width, control.Height - radius); path.AddArc(control.Width - radius, control.Height - radius, radius, radius, 0, 90); } else path.AddLine(control.Width, 0, control.Width, control.Height); if (bottomLeft) { path.AddLine(control.Width - radius, control.Height, radius, control.Height); path.AddArc(0, control.Height - radius, radius, radius, 90, 90); } else path.AddLine(control.Width, control.Height, 0, control.Height); if (topLeft) { path.AddLine(0, control.Height - radius, 0, radius); path.AddArc(0, 0, radius, radius, 180, 90); } else path.AddLine(0, control.Height, 0, 0); control.Region = new Region(path); } } catch (Exception e) { Console.WriteLine("При прорисовке элемента: " + control.Name + " Произошла ошибка: " + e); } } С телефона у лолзы проблема, только так могу кинуть пример кода