C#Windows窗体中的圆角

哈里·克里希南

我有一扇没有边界的窗户。我在网上搜索了圆角,但都带有边框。如何制作表格的圆角(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] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

C#Windows窗体中的标签对齐

来自分类Dev

如何在C#Windows窗体中创建选项窗体?

来自分类Dev

在C#Windows窗体中绑定组合框

来自分类Dev

C#Windows窗体中的计时器控件

来自分类Dev

如何清除C#Windows窗体中的DataGridView?

来自分类Dev

清除c#windows窗体中画在图片框上的线条

来自分类Dev

如何在C#Windows窗体中的特定位置放置打开窗体?

来自分类Dev

C#Windows窗体Tab顺序

来自分类Dev

C#Windows窗体着色随机按钮

来自分类Dev

C#Windows窗体LiveCharts GeoMap

来自分类Dev

C#Windows窗体-访问代码

来自分类Dev

修改c#Windows窗体控件库

来自分类Dev

C#Windows窗体和MYSQL

来自分类Dev

C#Windows窗体数据绑定

来自分类Dev

C#Windows窗体图表固定轴?

来自分类Dev

颜色丰富的TextBox C#Windows窗体

来自分类Dev

C#Windows窗体着色随机按钮

来自分类Dev

C#Windows窗体导出到Excel

来自分类Dev

c#windows窗体猜图片游戏

来自分类Dev

Windows 窗体的 Bunifu 圆角 - C#

来自分类Dev

覆盖C#Windows应用程序窗体中的透明图片框?

来自分类Dev

如何在C#Windows窗体应用程序中激活spellCheck?

来自分类Dev

如何在C#Windows窗体应用程序中动态创建网格

来自分类Dev

如何使用C#Windows窗体从Excel中的多个单元格读取

来自分类Dev

最简单的Paint程序在C#Windows窗体中不起作用

来自分类Dev

C#Windows窗体中的VLC Videoplayer无法播放.flv Web文件

来自分类Dev

如何在C#Windows窗体中的可缩放图像上绘制

来自分类Dev

如何在C#Windows窗体中获取所有动态numericupdown值

来自分类Dev

使用C#Windows窗体将CSV文件插入到mysql数据库表中