資源簡介
通過自定義控件,編程實現的儀表盤形狀的控件,可以加到Winform程序里做動態顯示數據,美化界面。使用方便簡單。
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Drawing;
using?System.Data;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
namespace?yibiaopan
{
????public?partial?class?yibaopan:?UserControl
????{
????????public?yibaopan()
????????{
????????????InitializeComponent();
????????????//以下設置??對繪圖效果更好?有在緩沖區繪制??在屏幕上顯示?防止閃爍
????????????this.Setstyle(Controlstyles.AllPaintingInWmPaint?true);
????????????this.Setstyle(Controlstyles.DoubleBuffer?true);
????????????this.Setstyle(Controlstyles.ResizeRedraw?true);
????????????this.Setstyle(Controlstyles.Selectable?true);
????????????this.Setstyle(Controlstyles.SupportsTransparentBackColor?true);
????????????this.Setstyle(Controlstyles.UserPaint?true);
????????}
????????//第一步:根據準備工作創建對應屬性
????????//當前數值
????????private?double?currentValue?=?0.0;
????????public?double?CurrentValue
????????{
????????????get?{?return?currentValue;?}
????????????set
????????????{
????????????????currentValue?=?value;
????????????????this.Invalidate();//是控件重繪??就是刷新
????????????}
????????}
????????//外環顏色
????????private?Color?outColor?=?Color.FromArgb(141194225);
????????public?Color?OutColor
????????{
????????????get?{?return?outColor;?}
????????????set?{
????????????????outColor?=?value;
????????????????this.Invalidate();//是控件重繪??就是刷新
????????????}
????????}
????????//第一層顏色
????????Color?firstColor?=?Color.FromArgb(110?111?219);
????????public?Color?FirstColor
????????{
????????????get?{?return?firstColor;?}
????????????set
????????????{
????????????????firstColor?=?value;
????????????????this.Invalidate();//是控件重繪??就是刷新
????????????}
????????}
????????//第二層顏色
????????Color?secondColor?=?Color.FromArgb(150?251?243);
????????public?Color?SecondColor
????????{
????????????get?{?return?secondColor;?}
????????????set
????????????{
????????????????secondColor?=?value;
????????????????this.Invalidate();//是控件重繪??就是刷新
????????????}
????????}
????????//第三層顏色
????????Color?thirdColor?=?Color.FromArgb(239?192?138);
????????public?Color?ThirdColor
????????{
????????????get?{?return?thirdColor;?}
????????????set
????????????{
????????????????thirdColor?=?value;
????????????????this.Invalidate();//是控件重繪??就是刷新
????????????}
????????}
????????//字體顏色
????????Color?textColor?=?Color.Black;
????????public?Color?TextColor
????????{
????????????get?{?return?textColor;?}
????????????set
????????????{
????????????????textColor?=?value;
????????????????this.Invalidate();//是控件重繪??就是刷新
????????????}
????????}
????????//外圓寬度
????????int?outwidth?=?4;
????????public?int?Outwidth
????????{
????????????get?{?return?outwidth;?}
????????????set
????????????{
????????????????outwidth?=?value;
????????????????this.Invalidate();//是控件重繪??就是刷新
????????????}
????????}
????????//外圓間隙
????????int?outgap?=?5;
????????public?int?Outgap
????????{
????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-08-28?10:13??C#Winform儀表盤控件\
?????目錄???????????0??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\
?????目錄???????????0??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\.vs\
?????目錄???????????0??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\.vs\yibiaopan\
?????目錄???????????0??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\.vs\yibiaopan\v15\
?????文件???????57856??2019-11-08?15:47??C#Winform儀表盤控件\yibiaopan\.vs\yibiaopan\v15\.suo
?????目錄???????????0??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\.vs\yibiaopan\v15\Server\
?????目錄???????????0??2019-11-08?15:46??C#Winform儀表盤控件\yibiaopan\.vs\yibiaopan\v15\Server\sqlite3\
?????文件???????????0??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\.vs\yibiaopan\v15\Server\sqlite3\db.lock
?????文件??????585728??2019-08-28?14:36??C#Winform儀表盤控件\yibiaopan\.vs\yibiaopan\v15\Server\sqlite3\storage.ide
?????文件???????32768??2019-11-08?15:46??C#Winform儀表盤控件\yibiaopan\.vs\yibiaopan\v15\Server\sqlite3\storage.ide-shm
?????文件???????????0??2019-11-08?15:46??C#Winform儀表盤控件\yibiaopan\.vs\yibiaopan\v15\Server\sqlite3\storage.ide-wal
?????目錄???????????0??2019-08-28?14:34??C#Winform儀表盤控件\yibiaopan\yibiaopan\
?????文件????????1125??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\yibiaopan.sln
?????目錄???????????0??2019-08-28?10:14??C#Winform儀表盤控件\yibiaopan\yibiaopan\bin\
?????目錄???????????0??2019-08-28?11:01??C#Winform儀表盤控件\yibiaopan\yibiaopan\bin\Debug\
?????文件????????9216??2019-11-08?15:46??C#Winform儀表盤控件\yibiaopan\yibiaopan\bin\Debug\yibiaopan.dll
?????文件???????28160??2019-11-08?15:46??C#Winform儀表盤控件\yibiaopan\yibiaopan\bin\Debug\yibiaopan.pdb
?????目錄???????????0??2019-08-28?10:14??C#Winform儀表盤控件\yibiaopan\yibiaopan\bin\Release\
?????目錄???????????0??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\
?????目錄???????????0??2019-08-28?14:32??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\Debug\
?????文件?????????819??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????6840??2019-08-28?10:14??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????????0??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件???????????0??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件???????????0??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????目錄???????????0??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\Debug\TempPE\
?????文件??????????42??2019-08-28?10:14??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\Debug\yibiaopan.csproj.CoreCompileInputs.cache
?????文件?????????654??2019-08-28?11:38??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\Debug\yibiaopan.csproj.FileListAbsolute.txt
?????文件?????????942??2019-08-28?14:32??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\Debug\yibiaopan.csproj.GenerateResource.cache
?????文件???????10254??2019-08-28?10:13??C#Winform儀表盤控件\yibiaopan\yibiaopan\obj\Debug\yibiaopan.csprojAssemblyReference.cache
............此處省略9個文件信息
評論
共有 條評論