Пытаюсь закруглить кнопки, первые 2 нормально, а остальные по пизде пошли, чё только не пытался их просто срезает, а мне нужно туда ещё и картинки вставить
Делай через Arc'и и линии. Вот как я давно это делал: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Drawing; namespace DooDHack_v2.Main_Window.Grafics { public class SharePath { public static void SetRoundedShape(Control control, int radius, bool topRight, bool topLeft, bool bottomLeft, bool bottomRight) { try { System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.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 System.Drawing.Region(path); Console.WriteLine("Элемент " + control.Name + " был прорисован."); } catch (Exception e) { Console.WriteLine("При прорисовке элемента: " + control.Name + " Произошла ошибка: " + e ); } } } C# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Drawing; namespace DooDHack_v2.Main_Window.Grafics { public class SharePath { public static void SetRoundedShape(Control control, int radius, bool topRight, bool topLeft, bool bottomLeft, bool bottomRight) { try { System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.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 System.Drawing.Region(path); Console.WriteLine("Элемент " + control.Name + " был прорисован."); } catch (Exception e) { Console.WriteLine("При прорисовке элемента: " + control.Name + " Произошла ошибка: " + e ); } } }
BANK1R_inactive2798101, создаёшьв кнопке boarder, у него есть свойство CornerRadius и задаешь радиус. Подробнее можешь узнать в гугле
BANK1R_inactive2798101, тут я не помощник :jerry: Гугл всему голова, ищи ответы вводя запросы по-английски
Есть же готовый решения.. Скачиваешь Bunifu с Нугета, заменяешь дллку на эту https://github.com/cydolo/CyberReverse/r...ensing.rar это нужно так как он платный. И все, там есть готовые кнопки где нужно просто выставить Border Radius. P.S Так же есть кнопки куда пикчу вставить можно и много настроек для этого.
livecoder, Ну там нету ничего связанного с тем что мне надо, вопрос всёравно открыт (Как добавить картику и скруглить на ней края) на ButtonImage нету радиуса
BANK1R_inactive2798101, у меня есть все что в видосе, я больше не знаю как тебе подсказать, можешь сам в коде руками делать кнопки если считаешь что так удобнее. Расскажу тебе секрет, у тебя нет этого так как там куча разных кнопок выбери нужную, только что чекнул есть кнопка как у тебя есть как у него, все есть.