資源簡(jiǎn)介
一組基于C#開發(fā)的數(shù)碼管顯示與控制程序示例

代碼片段和文件信息
/*?
?*?Segmented?led?displayer?Origionaly?developed?by?Liu?Xia?-?lxconan@gmail.com
?*?Feel?free?to?use?this?control?in?your?application?or?to?improve?it?anyway.
?*?I?will?be?very?glad?if?you?can?send?me?a?copy?if?you?improve?it.
?*?
?*?[2007-07-18]
?*?Performance?improvement:?DrawSingleCharWithFadedBk(...)?method?added?to?
?*?prevent?drawing?faded?background?character(‘8‘)?every?time.
?*?
?*?[2007-07-18]
?*?Performance?improvement:?Using?cached?path?to?prevent?calculating?paths?in
?*?painting?action.
?*?
?*?[2008-04-30]
?*?Add?Smooth?drawing?and?Italic?text?support.
?*?
?*?[2008-04-30]
?*?Bug?fixed?when?user?wants?to?draw?regular?rect?bound.
?*?
?*?[2008-05-10]
?*?The?text?on?the?control?can?now?be?copied?to?clipboard.
?*?Bug?fixed?:?the?anti-alias?effect?disappeared?when?the?rect?bound?is?a?
?*?????????????regulare?one
?*/
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Drawing;
using?System.Data;
using?System.Text;
using?System.Windows.Forms;
using?System.Drawing.Drawing2D;
namespace?LxControl
{
????///?
????///?A?control?that?acts?like?a?LED?displayer
????///?
????public?class?LxLedControl?:?Control?ISupportInitialize
????{
????????#region?Nested?Types
????????///?
????????///?Specify?how?the?text?or?value?is?aligned.
????????///?
????????public?enum?Alignment
????????{
????????????///?
????????????///?The?text?or?value?will?align?on?the?left?side?of?the?control.
????????????///?
????????????Left?=?0
????????????///?
????????????///?The?text?or?value?will?align?on?the?right?side?of?the?control.
????????????///?
????????????Right?=?1
????????}
????????#endregion
????????#region?Constructor
????????///?
????????///?Construct?one?LxLedControl?instance.
????????///?
????????public?LxLedControl()
????????{
????????????//?double?buffered
????????????this.Setstyle(Controlstyles.OptimizedDoubleBuffer?true);
????????????//?support?transplant?background
????????????this.Setstyle(Controlstyles.SupportsTransparentBackColor?true);
????????????//?default?color
????????????this.ForeColor?=?Color.LightGreen;
????????????this.BackColor?=?Color.Transparent;
????????????//?event?handler
????????????this.Click?+=?new?EventHandler(EvClick);
????????????this.KeyDown?+=?new?KeyEventHandler(EvKeyDown);
????????????this.GotFocus?+=?new?EventHandler(EvFocus);
????????????this.LostFocus?+=?new?EventHandler(EvFocus);
????????}
????????///?
????????///?Destructor
????????///?
????????///?whether?this?method?is?called?by?Dispose()
????????protected?override?void?Dispose(bool?disposing)
????????{
????????????DestoryCache();
????????????base.Dispose(disposing);
????????}
????????#endregion
????????#region?Helper?Function
????????///?
????????///?Paint?one?segment.
????????///?
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????381678??2007-07-15?00:15??Ledcontrol_src\LEDControl\applications.ico
?????目錄??????????0??2008-11-04?21:25??Ledcontrol_src\LEDControl\bin\Debug
?????文件?????417792??2008-11-04?21:25??Ledcontrol_src\LEDControl\bin\Release\Lxsoft.Controls.LedControl.dll
?????文件??????40448??2008-11-04?21:25??Ledcontrol_src\LEDControl\bin\Release\Lxsoft.Controls.LedControl.pdb
?????文件??????16102??2008-11-04?21:25??Ledcontrol_src\LEDControl\bin\Release\Lxsoft.Controls.LedControl.xm
????..AD...?????????0??2008-11-04?21:25??Ledcontrol_src\LEDControl\bin\Release
????..AD...?????????0??2008-11-04?21:25??Ledcontrol_src\LEDControl\bin
?????文件???????2605??2008-05-07?11:41??Ledcontrol_src\LEDControl\LEDControl.csproj
?????文件?????100866??2008-05-10?12:56??Ledcontrol_src\LEDControl\LxLedControl.cs
?????目錄??????????0??2008-11-04?21:25??Ledcontrol_src\LEDControl\obj\Debug\TempPE
?????目錄??????????0??2008-11-04?21:25??Ledcontrol_src\LEDControl\obj\Debug
?????文件????????264??2008-11-04?21:25??Ledcontrol_src\LEDControl\obj\LEDControl.csproj.FileList.txt
?????文件?????417792??2008-11-04?21:25??Ledcontrol_src\LEDControl\obj\Release\Lxsoft.Controls.LedControl.dll
?????文件??????40448??2008-11-04?21:25??Ledcontrol_src\LEDControl\obj\Release\Lxsoft.Controls.LedControl.pdb
?????目錄??????????0??2008-11-04?21:25??Ledcontrol_src\LEDControl\obj\Release\TempPE
?????目錄??????????0??2008-11-04?21:25??Ledcontrol_src\LEDControl\obj\Release
?????目錄??????????0??2008-11-04?21:25??Ledcontrol_src\LEDControl\obj
?????文件???????1444??2007-07-15?00:15??Ledcontrol_src\LEDControl\Properties\AssemblyInfo.cs
????..AD...?????????0??2008-11-04?21:25??Ledcontrol_src\LEDControl\Properties
????..AD...?????????0??2008-11-04?21:25??Ledcontrol_src\LEDControl
?????文件???????2808??2008-05-07?11:41??Ledcontrol_src\LEDControl.sln
????..A..H.?????20144??2008-11-04?21:25??Ledcontrol_src\LEDControl.suo
?????目錄??????????0??2008-11-04?21:25??Ledcontrol_src\TestControl\bin\Debug
?????目錄??????????0??2008-11-04?21:25??Ledcontrol_src\TestControl\bin\Release
????..AD...?????????0??2008-11-04?21:25??Ledcontrol_src\TestControl\bin
?????文件?????381678??2007-07-17?15:09??Ledcontrol_src\TestControl\button?green.ico
?????文件????????540??2008-05-07?13:23??Ledcontrol_src\TestControl\Form1.cs
?????文件???????8847??2008-05-07?13:23??Ledcontrol_src\TestControl\Form1.Designer.cs
?????文件???????6008??2008-05-07?13:23??Ledcontrol_src\TestControl\Form1.resx
?????目錄??????????0??2008-11-04?21:25??Ledcontrol_src\TestControl\obj\Debug\TempPE
............此處省略19個(gè)文件信息
評(píng)論
共有 條評(píng)論