国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發(fā)設計 > 正文

The Amazing ProgressBar Control(轉(zhuǎn))

2019-11-17 02:54:24
字體:
供稿:網(wǎng)友

The Amazing PRogressBar Control(轉(zhuǎn))

好久沒寫博客了,今天就先轉(zhuǎn)一篇,隨后可以再寫些~~~

直接把原文粘過來,就不再進行翻譯和個人說明了,因為效果很COOL~


The Amazing ProgressBar Control

A progress bar which displays progress as passage through a simple maze.

  • Download AmazingProgressBar_111_Demo.zip
  • Download AmazingProgressBar_111_Library.zip
  • Download AmazingProgressBar_111_Source.zip

Introduction

This is release 1.1.1 of the library. The .csproj files were converted for use in Visual Studio 2013, and the help files were updated to work with the latest release of Sandcastle Help File Builder (2014.5.31.0).

The AmazingProgressBar class is a drop-in replacement for the .NET 2.0 ProgressBar control, which displays progress as passage through a simple maze.

AmazingProgressBar_Examples

All public and protected classes, methods, and properties are fully documented using standard C# xml documentation comments. The project includes an HTML help file. Refer to the Overview section in the help file for more details on using the class.

The library download includes:

AmazingProgressBar.dllClass library
AmazingProgressBar.chmHelp file

The demo download includes the above files, as well as:

AmazingExplorer.exeSample program for experimenting with the various properties of the control.
AmazingExamples.exeSample program displaying a variety of AmazingProgressBar examples.

The source download includes the source for all of the above programs, as well as the necessary files for building the help file.

Compatibility with Other .NET Framework Versions

The AmazingProgressBar library is compiled using .NET Framework version 2.0. To confirm that there were no issues with other framework versions, the compiled library was used by an application which was compiled, in turn, under .NET Framework versions 3.0, 3.5, 4.0, and 4.5. The AmazingProgressBar functioned properly with all of them.

Background

One day, while waiting for a long computational task to complete, I realized just how uninteresting the standard progress bar is. There had to be something more entertaining than a colored bar creeping slowly across the screen. After thinking about the problem for a while, I hit upon the idea of a progress bar which winds through a maze. And hence was born, the AmazingProgressBar control.

The AmazingProgressBar is pure eye candy. It won't make the task run any faster, but it might make the wait a bit less boring!

Using the Code

To use the AmazingProgressBar class, simply add it on an existing form:

AmazingProgressBar amaze = new AmazingProgressBar();amaze.Location = new System.Drawing.Point(0, 0);amaze.Size = new System.Drawing.Size(200, 50);form.Controls.Add(amaze);

You can also replace any existing ProgressBar with AmazingProgressBar.

The progress direction and general style of the maze is determined by the MazeStyle property:

SingleRightMaze with a single path progressing left to right.
SingleLeftMaze with a single path progressing right to left.
SingleUpMaze with a single path progressing up.
SingleDownMaze with a single path progressing down.
SplitConvergeHorizontalMaze with two paths starting at the left and right ends, converging in the middle.
SplitConvergeVerticalMaze with two paths starting at the top and bottom, converging in the middle.
SplitDivergeHorizontalMaze with two paths starting in the middle, ending at the left and right ends.
SplitDivergeVerticalMaze with two paths starting in the middle, ending at the top and bottom.

The mazes generally have one route over which they can be traversed, but a small amount of branching may occur if RowCount is greater than 3. The maze direction(s) is/are the general direction(s), though there will always be twists and turns and some doubling back.

The size and complexity of the maze generally depends on the RowCount parameter. Set this parameter to fix the number of rows in the maze. A value of 1 results in a maze which looks just like a standard progress bar. A value of 2 results in a distinctly uninteresting maze. A value of 3 or more is strongly recommended.

The number of columns in the maze is the largest value given the size of the control, the current values of RowCount, WallSize, and BorderSize, and the rule that all cells in the maze must be square.

The ProgressBar.Style property can still be set. The Marquee style works as expected, but if the maze length is excessive, it may not work as fast as expected. The Blocks style is generally not as visually appealing as Continuous, though an interesting effect is to be had combining Blocks with a zero WallSize.

The following code segment shows how to set the Style, MazeStyle, and the number of rows.

// Assumes "AmazingProgressBar amaze" already declared and initializedamaze.Style = ProgressBarStyle.Continous;amaze.MazeStyle = MazeStyleType.SingleLeft;amaze.RowCount = 4;

If the control cannot generate a maze, then the control is filled with a pink - on - black ripple pattern. This is usually the result of RowCount being too high or too low.

AmazingProgressBar_Bad

The filled cells inside the maze can either all be the same fixed color, or follow a color gradient. This is determined by the Gradient property:

NoneNo gradient coloring. All filled cells are ForeColor.
RowsEach row in the maze is a different color, spanning a gradient with the first row being GradientStartColor, and the last row being GradientEndColor.
ColumnsEach column in the maze is a different color, spanning a gradient with the first column being GradientStartColor, and the last column being GradientEndColor.
FlowEach cell in the maze is a different color, spanning a gradient with the first cell being GradientStartColor, and the last cell being GradientEndColor.

All unfilled cells are always BackColor.

The maze walls are visible if WallSize is greater than zero. The walls can only be one fixed color, as indicated by the WallColor property.

The maze border can either be one fixed color, or a gradient from that fixed color to the default control color. The maze border can also have round corners.

The following code segment shows how to set the various color properties.

// Assumes "AmazingProgressBar amaze" already declared and initializedamaze.Gradient = GradientType.Rows;amaze.GradientStartColo
上一篇:Unit Test

下一篇:C# 編寫的串口通信程序

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 垫江县| 泉州市| 元江| 临沧市| 特克斯县| 河津市| 静宁县| 临澧县| 双城市| 汪清县| 延津县| 佛学| 阳城县| 黄浦区| 扎兰屯市| 湘阴县| 桦川县| 镇沅| 临湘市| 沈阳市| 通渭县| 富顺县| 肃宁县| 南川市| 北辰区| 平舆县| 岳普湖县| 罗田县| 涞水县| 吉林省| 崇仁县| 紫金县| 北海市| 怀化市| 泰安市| 无锡市| 徐汇区| 黑龙江省| 徐汇区| 滁州市| 蕲春县|