79735100

Date: 2025-08-14 07:50:57
Score: 0.5
Natty:
Report link

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
    {
    
    }
}

newoutput

Reasons:
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: user3103982