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();
相关文档:
xml文件:
<?xml version="1.0" encoding="utf-8" ?>
<bookstore>
<book>
<title lang="eng">Harry Potter</title>
<price>29.99</price>
</book>
<book>
......
现在很多软件都是以xml文件作为数据源,而很多数据工具如pb等却只能另存为txt、excel等格式,为此需要一工具能将txt文本转换成xml文件。google了一下,没找到合适的,冲动之下用C#写了一个txt文本转xml格式文本的小程序,代码如下。
新建一个w ......
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Office.Inter ......
---------------------------------------
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# 注册控件-在运行输 ......