C#源代码实现进度条功能.doc

C#源代码实现进度条功能.doc

ID:57645930

大小:51.00 KB

页数:7页

时间:2020-08-30

C#源代码实现进度条功能.doc_第1页
C#源代码实现进度条功能.doc_第2页
C#源代码实现进度条功能.doc_第3页
C#源代码实现进度条功能.doc_第4页
C#源代码实现进度条功能.doc_第5页
资源描述:

《C#源代码实现进度条功能.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、C#使用GProgressBar控件,源代码实现进度条功能开发环境VS2008这个进度条控件,除了具有普通进度条的功能以外,还具有如下功能:设置进度条的背景色和前景色设置进度条的外观方式(3d,single,none)是否自动显示当前进度比例(比如在进度条的中间显示当前进度58%)当然,这个功能还可以增加很多,比如背景色和前景色也可以用图片代替,还有其它的功能代码如下:usingsystem;usingsystem.collections;usingsystem.componentmodel;usingsystem.drawing;usingsystem.

2、drawing.drawing2d;usingsystem.data;usingsystem.windows.forms;namespacexiaopang.windows{///

///gprogressbar的摘要说明。///publicclassgprogressbar:system.windows.forms.usercontrol{//////必需的设计器变量。///privatesystem.componentmodel.containercomponents=null;

3、publicgprogressbar(){//该调用是windows.forms窗体设计器所必需的。initializecomponent();base.height=23;this.resize+=neweventhandler(gprogressbar_resize);this.locationchanged+=neweventhandler(gprogressbar_resize);}privatevoidgprogressbar_resize(objectsender,system.eventargse){base.refresh();}priva

4、teintmmax=100;[browsable(true),description("最大值"),category("xiaopang")]publicintmax{get{returnmmax;}set{mmax=value>0?value:1;}}[browsable(true),description("大小"),category("xiaopang")]publicnewsizesize{get{returnbase.size;}set{base.size=value;}}privateintmmin=0;[browsable(true),des

5、cription("最小值"),category("xiaopang")]publicintmin{get{returnmmin;}set{mmin=value;}}privateintmstep=1;[browsable(true),description("步长"),category("xiaopang")]publicintstep{get{returnmstep;}set{mstep=value;}}[browsable(true),description("背景色"),category("xiaopang")]publicoverridecolo

6、rbackcolor{get{returnbase.backcolor;}set{base.backcolor=value;}}[browsable(true),description("前景色"),category("xiaopang")]publicoverridecolorforecolor{get{returnbase.forecolor;}set{base.forecolor=value;}}privateboolmrate=false;[browsable(true),description("是否显示比例数字"),category("xiao

7、pang")]publicboolrate{get{returnmrate;}set{mrate=value;}}privateintmvalue=0;[browsable(true),description("当前值"),category("xiaopang")]publicintvalue{get{returnmvalue;}set{if(value<=this.max)mvalue=value;elsemvalue=this.max;this.refresh();}}privateborderstylemborderstyle=borderstyle

8、.fixed3d;[defaultvalue(0),categor

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。