示例#1
0
        private void CustomControl_UpDown_SizeChanged(object sender, EventArgs e)
        {
            // 角丸長方形のGraphicsPathを作成します。
            GraphicsPath path = CommonProc.GetRoundRect(DisplayRectangle, 5);

            //Panelの形を角丸長方形に変更
            this.Region = new Region(path);
        }
示例#2
0
        private void buttonText_Paint(object sender, PaintEventArgs e)
        {
            Rectangle    rect = new Rectangle(0, 0, this.Width, this.Height);
            GraphicsPath path = CommonProc.GetRoundRect(rect, 5);

            //ペン作成
            Pen linePen = new Pen(Color.Black, 2);

            // フォームに描画します。
            e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
            e.Graphics.DrawPath(linePen, path);

            //ペン削除
            linePen.Dispose();
        }
示例#3
0
 private void CustomControl_UpDown_Paint(object sender, PaintEventArgs e)
 {
     // フォームに描画します。
     e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
     e.Graphics.DrawPath(new Pen(Color.Black, 2.0f), CommonProc.GetRoundRect(DisplayRectangle, 5));
 }