资源简介
c#自己做的自定义透明按钮控件,简单实用。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
namespace thirdbuttons
{
public partial class button2 : Button
{
///
/// 必需的设计器变量。
///
//private System.ComponentModel.Container components = null;
private bool XiaCen = false;
private bool mouseMove = false;
private Color backColor;
public button2()
{
InitializeComponent();
// TODO: 在 InitComponent 调用后添加任何初始化
backColor = this.backColor;
//this.Text=this.ShowFocusCues.ToString();
}
protected GraphicsPath GetGraphicsPath(Rectangle rect)
{
GraphicsPath ClientPath = new System.Drawing.Drawing2D.GraphicsPath();
if (rect.Width <= 0)
{
rect.Width = 1;
}
if (rect.Height <= 0)
{
rect.Height = 1;
}
ClientPath.AddArc(rect.Left rect.Top rect.Height rect.Height 90f 180f);
ClientPath.AddArc(rect.Right - rect.Height rect.Top rect.Height rect.Height 270f 180f);
ClientPath.CloseFigure();
return ClientPath;
}
protected GraphicsPath GetGraphicsPath1(Rectangle rect)
{
GraphicsPath ClientPath = new System.Drawing.Drawing2D.GraphicsPath();
if (rect.Width <= 0)
{
rect.Width = 1;
}
if (rect.Height <= 0)
{
rect.Height = 1;
}
ClientPath.AddArc(rect.Left rect.Top rect.Height rect.Height 190f 80f);
ClientPath.AddArc(rect.Right - rect.Height rect.Top rect.Height rect.Height 270f 80f);
ClientPath.CloseFigure();
return ClientPath;
}
private void DrawYinYing(Graphics gr bool xiacen)
{
Rectangle rect = this.ClientRectangle;
rect.Inflate(-(rect.Width / 10) -(rect.Height) / 4);
float bf1 = rect.Width / 100f;
float bf2 = rect.Height / 100f;
rect.Y = rect.Y + this.ClientRectangle.Height / 4;
if (xiacen)
{
rect.Y = rect.Y + 4;
}
GraphicsPath path;
for (int a = 1; a < 33; a++)
{
float bf3 = bf1 * a;
float bf4 = bf2 * a;
Rectangle rect1 = rect;
rect1.Inflate(-(int)bf3 -(int)bf4);
path = GetGraphicsPath(rect1);
int r = backColor.R;
int g = backColor.G;
int b = backColor.B;
r =
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 925 2009-08-26 14:28 thirdbuttons\thirdbuttons.sln
..A..H. 12800 2009-08-26 17:19 thirdbuttons\thirdbuttons.suo
文件 2282 2009-08-26 17:17 thirdbuttons\thirdbuttons\thirdbuttons.csproj
文件 1317 2009-08-26 14:28 thirdbuttons\thirdbuttons\Properties\AssemblyInfo.cs
文件 19968 2009-08-26 17:19 thirdbuttons\thirdbuttons\obj\Debug\thirdbuttons.pdb
文件 20480 2009-08-26 17:19 thirdbuttons\thirdbuttons\obj\Debug\thirdbuttons.dll
文件 154 2009-08-26 17:19 thirdbuttons\thirdbuttons\obj\thirdbuttons.csproj.FileList.txt
文件 20480 2009-08-26 17:19 thirdbuttons\thirdbuttons\bin\Debug\thirdbuttons.dll
文件 19968 2009-08-26 17:19 thirdbuttons\thirdbuttons\bin\Debug\thirdbuttons.pdb
文件 1887 2009-08-26 17:16 thirdbuttons\thirdbuttons\button2.Designer.cs
文件 7967 2009-08-26 17:16 thirdbuttons\thirdbuttons\button2.cs
目录 0 2009-08-26 14:36 thirdbuttons\thirdbuttons\obj\Debug\TempPE
目录 0 2009-08-26 17:16 thirdbuttons\thirdbuttons\obj\Debug\Refactor
目录 0 2009-08-26 14:36 thirdbuttons\thirdbuttons\obj\Debug
目录 0 2009-08-26 14:36 thirdbuttons\thirdbuttons\bin\Debug
目录 0 2009-08-26 14:36 thirdbuttons\thirdbuttons\Properties
目录 0 2009-08-26 14:36 thirdbuttons\thirdbuttons\obj
目录 0 2009-08-26 14:36 thirdbuttons\thirdbuttons\bin
目录 0 2009-08-26 14:36 thirdbuttons\thirdbuttons
目录 0 2009-08-26 14:36 thirdbuttons
----------- --------- ---------- ----- ----
108228 20
- 上一篇:WPF C# 轮播图
- 下一篇:C#考试答题系统
相关资源
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
评论
共有 条评论