c#窗体圆角透明效果

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); 
        }   

    }
}


推荐好友:
文章来自: 互联网
引用通告地址: :http://www.loverer.com/trackback.asp?tbID=JOKOHPQ8&key=JOKOOOISEQNNCON0
标签检索: C# 窗体圆角 窗体透明
相关日志:
  n C#编写QQ接口软件--QQ协议篇[8205]
  n asp.net生成高质量缩略图通用函数(c#代码),支持多种生成方式[2886]
  n 从数据库调用图片和保存图片[1137]
  n 用Visual C#实现P2P应用程序(来源互联网)[3059]
  n 用C#实现汉字转化为拼音[1072]
  n C#下用P2P技术实现点对点聊天 (来源互联网)[3097]
  n 用C#实现蜘蛛/爬虫程序的多线程控制[1012]
  n 在.Net下发送邮件(C#)[2085]
  n C#支持SMTP验证的发送邮件组件[905]
  n 在C#中利用SharpZipLib进行文件的压缩和解压缩 [760]

评论: 0 | 引用: 0 | 查看次数: 1343
发表评论
昵 称:
密 码: 游客发言不需要密码.
验证码: 点击可刷新此验证码
内 容:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭