我有一扇没有边界的窗户。我在网上搜索了圆角,但都带有边框。如何制作表格的圆角(not with borders)
?有没有办法做到这一点?
我是C#的新手,所以请解释一下...
谢谢
试试这个:
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
[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, // width of ellipse
int nHeightEllipse // height of ellipse
);
public Form1()
{
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.None;
Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20));
}
}
}
从这里开始:C#中带有圆角边框的形式?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句