资源简介
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#考试答题系统
- WPF C# 轮播图
- [c#]B+树的C#实现-BPlusTreePrototype
- 用C# 模仿 WINDOWS计算器 编写的 计算器
- WInform LED 时钟显示源码及Dll C#控件
- C# 通过COM端口读取数据
- C#桌面右下角弹出提示窗
- C#利用Remoting实现文件上传
- C#实现MQTT协议
- c#winform开发仓库管理系统,vs2010,m
- C#中DataSet的用法很详细
- C# 职员管理系统
- C#实现增删改查 学生管理系统
- C# 远程连接RDPdemo
- C#版winform中使用的ToggleButton
- CLR Via C#(第4版) 完整源代码
- 计算机图形学 扫描线种子填充算法
- C# 利用反射动态创建对象
- c#下post multipart/form-data和JSON
- C# OracleHelper
- c#微信企业号推送消息,亲测通过__(
- 自定义的ListView(C#) 可以在任意列
- C# 后台HTML代码拼接工具
- 基于C#的FTP客户端的实现(网络编程课
- c#获取系统和指定进程的CPU和内存占用
- udp打洞源码服务端和客户端C# 实现
- [c#]wince平台下的GPIO接口使用测试程序
- C#中使用ACCESS数据库进行查询WinForm程
- 放大,缩小,图形显示C#+ARCENGINE.rar
- A*算法C#实现,三次B样条优化
评论
共有 条评论