わかりました、私はこのコードでフォームを作成しました:this.FormBorderStyle = FormBorderStyle.None;
わかりました、私はこのコードで境界線の半径も追加しました:
[DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
private static extern IntPtr CreateRoundRectRgn
(
int nLeftRect, // x-coordinate of upper-left corner
int nTopRect, // y-coordinate of upper-left corner
int nRightRect, // x-coordinate of lower-right corner
int nBottomRect, // y-coordinate of lower-right corner
int nWidthEllipse, // height of ellipse
int nHeightEllipse // width of ellipse
);
public Form4()
{
InitializeComponent();
Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20));
}
だから、私が必要とするのは、ボーダー半径でカーブするフォームの周りに小さな黒い境界線を追加することです。それ、どうやったら出来るの?
わかりました、私はこれを追加しました、それは動作しますが、それは境界線に沿っていません、それはただ海峡になります:e.Graphics.DrawRectangle(Pens.Black, new Rectangle(0, 0, Width - 1, Height - 1));
そしてこれ:
ControlPaint.DrawBorder(e.Graphics, this.ClientRectangle, Color.Black, ButtonBorderStyle.Solid);