For anyone who's interested, I converted that code to C#:
public GraphicsPath GetGraphicsPath(int x, int y, int width, int height,
int radius)
{
GraphicsPath gp = new GraphicsPath();
gp.AddLine(x + radius, y, x + width - radius, y);
gp.AddArc(x + width - radius, y, radius, radius, 270, 90);
gp.AddLine(x + width, y + radius, x + width, y + height - radius);
gp.AddArc(x + width - radius, y + height - radius, radius, radius, 0,
90);
gp.AddLine(x + width - radius, y + height, x + radius, y + height);
gp.AddArc(x, y + height - radius, radius, radius, 90, 90);
gp.AddLine(x, y + height - radius, x, y + radius);
gp.AddArc(x, y, radius, radius, 180, 90);
gp.CloseFigure();
return gp;
}
public void DrawRoundRect(Graphics g, Pen p, int x, int y, int width, int
height, int radius)
{
GraphicsPath gp = GetGraphicsPath(x, y, width, height, radius);
g.DrawPath(p, gp);
gp.Dispose();
}
public void FillRoundRect(Graphics g, Brush b, int x, int y, int width,
int height, int radius)
{
GraphicsPath gp = GetGraphicsPath(x, y, width, height, radius);
g.FillPath(b, gp);
gp.Dispose();
}