Hi this is the chatgpt version you might like this as well
private Rectangle GetCellBounds(int col, int row)
{
int x = tlp_tra_actual.GetColumnWidths().Take(col).Sum();
int y = tlp_tra_actual.GetRowHeights().Take(row).Sum();
int w = tlp_tra_actual.GetColumnWidths()[col];
int h = tlp_tra_actual.GetRowHeights()[row];
return new Rectangle(x, y, w, h);
}
void tableLayoutPanel1_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
{
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
try
{
int row = e.Row;
var g = e.Graphics;
float radiusFactor = 1.4f; // 1.0 = original, >1 = bigger arc
Rectangle cellRect = GetCellBounds(0, row);
// Make radius bigger than cell min size * factor
int baseRadius = Math.Min(cellRect.Width, cellRect.Height);
int radius = (int)(baseRadius * radiusFactor);
using (GraphicsPath path = new GraphicsPath())
{
// Move starting point higher up (because arc is larger)
path.StartFigure();
path.AddLine(cellRect.Left, cellRect.Bottom - radius, cellRect.Left, cellRect.Bottom);
path.AddLine(cellRect.Left, cellRect.Bottom, cellRect.Left + radius, cellRect.Bottom);
// Bigger arc, starts at bottom and sweeps up to left
path.AddArc(
cellRect.Left, // arc X
cellRect.Bottom - radius, // arc Y
radius, // arc width
radius, // arc height
90, 90);
path.CloseFigure();
using (Brush brush = new SolidBrush(Color.FromArgb(150, Color.DarkBlue)))
{
g.FillPath(brush, path);
}
}
}
catch
{
}
}