1
をバインドクリップ:
境界線がクリップしていません。
マイコード:は、どのように私はパネルの角を丸く作成しないと私は、私は以下のように問題を抱えているpanel.But周囲に境界線を描画しようとしている
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
int diameter = radius * 2;
Size size = new Size(diameter, diameter);
int w = size.Width-1;
int h = size.Height-1;
Rectangle arc = new Rectangle(bounds.Location.X, bounds.Location.Y, w, h);
GraphicsPath path = new GraphicsPath();
path.AddArc(arc, 180, 90);
arc.X = bounds.Right - diameter;
path.AddArc(arc, 270, 90);
arc.Y = bounds.Bottom- diameter;
path.AddArc(arc, 0, 90);
arc.X = bounds.Left;
path.AddArc(arc, 90, 90);
path.CloseFigure();
GraphicsPath GraphPath = path;
this.Region = new Region(GraphPath);
using (Pen pen = new Pen(Color.Blue, 1)) {
e.Graphics.DrawPath(pen, path);
}
}
あなたのソリューションは私を助けました!新しいBackgoundプロパティを追加し、パネル内のコントロールの透明に背景色を設定する必要があります。@ zockDoc – Jandy