资源简介
利用C#自带的控件实现圆形指示灯,通过按钮点击事件实现圆形指示灯变色。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace testOvalShape
{
public partial class Form1 : Form
{
int flag = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender EventArgs e)
{
flag=(++flag)%3;
if (flag == 0)
{
ovalShape1.FillColor = Color.DarkGray;
ovalShape1.FillGradientColor = Color.Gray;
}
if (flag == 1)
{
ovalShape1.FillColor = Color.Lime;
ovalShape1.FillGradientColor = Color.FromArgb(192255192);
}
if (flag == 2)
{
ovalShape1.FillColor = Color.Red;
ovalShape1.FillGradientColor = Color.PeachPuff;
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 9728 2018-08-16 21:41 testOvalShape\testOvalShape\bin\Debug\testOvalShape.exe
文件 19968 2018-08-16 21:41 testOvalShape\testOvalShape\bin\Debug\testOvalShape.pdb
文件 11600 2018-08-17 20:00 testOvalShape\testOvalShape\bin\Debug\testOvalShape.vshost.exe
文件 490 2010-03-17 22:39 testOvalShape\testOvalShape\bin\Debug\testOvalShape.vshost.exe.manifest
文件 1039 2018-08-16 12:01 testOvalShape\testOvalShape\Form1.cs
文件 3770 2018-08-16 12:01 testOvalShape\testOvalShape\Form1.Designer.cs
文件 5817 2018-08-16 12:01 testOvalShape\testOvalShape\Form1.resx
文件 10525 2018-08-16 21:41 testOvalShape\testOvalShape\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6549 2018-08-17 20:00 testOvalShape\testOvalShape\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 658 2018-08-17 20:00 testOvalShape\testOvalShape\obj\x86\Debug\testOvalShape.csproj.FileListAbsolute.txt
文件 975 2018-08-16 21:41 testOvalShape\testOvalShape\obj\x86\Debug\testOvalShape.csproj.GenerateResource.Cache
文件 14363 2018-08-16 21:41 testOvalShape\testOvalShape\obj\x86\Debug\testOvalShape.csprojResolveAssemblyReference.cache
文件 9728 2018-08-16 21:41 testOvalShape\testOvalShape\obj\x86\Debug\testOvalShape.exe
文件 180 2018-08-16 21:41 testOvalShape\testOvalShape\obj\x86\Debug\testOvalShape.Form1.resources
文件 19968 2018-08-16 21:41 testOvalShape\testOvalShape\obj\x86\Debug\testOvalShape.pdb
文件 180 2018-08-16 21:41 testOvalShape\testOvalShape\obj\x86\Debug\testOvalShape.Properties.Resources.resources
文件 494 2018-08-16 11:49 testOvalShape\testOvalShape\Program.cs
文件 1376 2018-08-16 11:49 testOvalShape\testOvalShape\Properties\AssemblyInfo.cs
文件 2878 2018-08-16 11:49 testOvalShape\testOvalShape\Properties\Resources.Designer.cs
文件 5612 2018-08-16 11:49 testOvalShape\testOvalShape\Properties\Resources.resx
文件 1100 2018-08-16 11:49 testOvalShape\testOvalShape\Properties\Settings.Designer.cs
文件 249 2018-08-16 11:49 testOvalShape\testOvalShape\Properties\Settings.settings
文件 3897 2018-08-16 11:57 testOvalShape\testOvalShape\testOvalShape.csproj
文件 881 2018-08-16 11:49 testOvalShape\testOvalShape.sln
..A..H. 57856 2018-08-16 21:47 testOvalShape\testOvalShape.suo
目录 0 2018-08-16 11:49 testOvalShape\testOvalShape\obj\x86\Debug\TempPE
目录 0 2018-08-16 21:41 testOvalShape\testOvalShape\obj\x86\Debug
目录 0 2018-08-16 21:41 testOvalShape\testOvalShape\bin\Debug
目录 0 2018-08-16 11:49 testOvalShape\testOvalShape\obj\x86
目录 0 2018-08-16 11:49 testOvalShape\testOvalShape\bin
............此处省略7个文件信息
- 上一篇:C#防盗链
- 下一篇:C# TCP/IP异步通信
评论
共有 条评论