C#绘制圆角窗体
public void SetWindowRegion()
{
System.Drawing.Drawing2D.GraphicsPath FormPath;
FormPath =
new System.Drawing.Drawing2D.GraphicsPath();
Rectangle
rect=new
Rectangle(0,22,this.Width,this.Height-22);//this.Left-10,this.Top-10,this.Width-10,this.Height-10);
FormPath = GetRoundedRectPath(rect, 30);
this.Region = new Region(FormPath);
}
private
GraphicsPath GetRoundedRectPath(Rectangle rect, int radius)
{
int diameter = radius;
Rectangle
arcRect = new Rectangle(rect.Location, new Size(diameter,
diameter));
GraphicsPath path = new GraphicsPath();
// 左上角
path.AddArc(arcRect, 180, 90);
// 右上角
arcRect.X = rect.Right - diameter;
path.AddArc(arcRect,
270, 90);
// 右下角
arcRect.Y = rect.Bottom -
diameter;
path.AddArc(arcRect, 0, 90);
// 左下角
arcRect.X = rect.Left;
path.AddArc(arcRect, 90, 90);
path.CloseFigure();
return path;
}
protected
override void OnResize(System.EventArgs e)
{
this.Region = null;
SetWindowRegion();
相关文档:
sd.xml文件:
<?xml version="1.0" encoding="gb2312"?>
<!--这是一个xml文件-->
<xml1>
<item name="1">第一个item</item>
<item name="2">
<item name="1">这个结点(1) ......
第一种方法:
string str="server=.;uid=sa;pwd=111111;database=text_db";//连接字符串
SqlConnection SCON = null;//连接对象
&n ......
首先需要在项目中添加(Microsoft XML, v3.0)的引用
using MSXML2;
private string VerifyNotifyURL(string URL)
{
MSXML2.XMLHTTPClass xmlhttp=new MSXML2.XMLHTTPClass();
try
{
&nbs ......
---------------------------------------
Asp.Net,C#,SQL,JS,WCF,AJAX,工作流,WPF,MVC,LINQ,设计模式(架构)等技术讨论
“ASP.NET(C#)Fans” QQ群:96877690
---------------------------------------
不管是J2SE、J2EE还是J2ME敬请加入!Eclipse、NetBeans
Java交流QQ高级群扩招:96878255 ......
C#与Flash交互 (转自小磊在线)
C#与Flash交互
前段日子公司要求做一个C#与Flash交互的东西,用来C#与短信猫通讯将数据传到Flash上显示与操作的应用。
第一步C#添加组件
打开VS2005-工具-选择工具箱项-COM组件-选择Shockwave Flash Object-确定
添加好组件往场景上拖放,如果提示注册需求注册
c# 注册控件-在运行输 ......