首页 | 新闻 | 网站建设 | 成功案例 | 服务项目 | 商业购买 | 编程技术 | 壁纸 | 休闲娱乐 | 下载专区 | 留言 | 论坛
 
您现在的位置:网站首页 > 编程技术 > C#.NET
c#窗体圆角透明效果
发布时间:2008-06-04  发布:奇景  关键字:c# 窗体圆角 透明效果  阅读次数:276  【字号

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace yjct
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Resize(object sender, EventArgs e)
        {
            Type(this, 25, 0.1);
        }
        private void Type(Control sender, int p_1, double p_2)
        {
            GraphicsPath oPath = new GraphicsPath();
            oPath.AddClosedCurve(new Point[] { new Point(0, sender.Height / p_1), new Point(sender.Width / p_1, 0), new Point(sender.Width - sender.Width / p_1, 0), new Point(sender.Width, sender.Height / p_1), new Point(sender.Width, sender.Height - sender.Height / p_1), new Point(sender.Width - sender.Width / p_1, sender.Height), new Point(sender.Width / p_1, sender.Height), new Point(0, sender.Height - sender.Height / p_1) }, (float)p_2);
            sender.Region = new Region(oPath);
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Type(this, 25, 0.1);
        }  

    }
}

【收藏此页】【复制网址】【打印】【关闭】返回上一级
 
相关评论
以下网友评论只代表个人观点,不代表本站立场

IP:124.156.67.33 2008-6-4 23:02:00
路过者
好啊,高手
  联系电话: E-Mail:
全选/不选  退出管理 页次:1/1  每页:5条  共1 条评论内容  

发表评论
 
呢 称: *
附加码: *请输入
E-Mail: [仅管理员可见]
电 话: [ 仅管理员可见]
内 容: *
       
 
 

 ≡相关主题≡
 
分类导航
本类最新
本周热门

  版权声明 | 关于本站 | 常见问题 | 联系我们 | 网站管理 | 页面顶端
CopyRight ? QScms.cn All Rights Reserved 福州帝威荣信息技术有限公司研发 业务联系:0591-87522535
互联网许可证:闽ICP备08002627号 QQ:812188106 邮箱:qscms@yahoo.cn
Power By QsCMS V3.0  执行时间 : 0.000 秒 页面装载: