资源简介
里面有两个例子 一个是最为简单的界面 显示一个简单的仪表盘,两外一个是加了背景图片的仪表盘 效果非常好看。是我在别人的基础上修改的。里面的源码都就可以修改 在vs2008上编译

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CarPanel
{
public partial class carpanel : UserControl
{
public carpanel()
{
InitializeComponent();
}
private void carpanel_Paint(object sender PaintEventArgs e)
{
int r=0;
float x1 x2 y1 y2 x3=0 y3=0 ;
int max = 360; //最大刻度值
float maxValue = 360.0F;//最大刻度值的float表示
Graphics g = e.Graphics;
Pen mypen = new Pen(Color.Red2);
Pen mypen2 = new Pen(Color.Black 1);
Brush mybrush = Brushes.Blue;
Font myfont =new Font(this.FontFontstyle.Bold);
g.DrawArc(mypen 0 0 base.Width base.Height * 2 max max);
int len = 5;//刻度线的长度
for (r = 10; r <= max; r += 10)//两个刻度之间的间隔
{
x1 = (float)(Math.Abs(base.Width / 2 - base.Height * Math.Cos(Math.PI * r / maxValue)));
x2 = (float)(Math.Abs(base.Width / 2 - (base.Height - len) * Math.Cos(Math.PI * r / maxValue)));
y1 = (float)(Math.Abs(base.Height - base.Height * Math.Sin(Math.PI * r / maxValue)));
y2 = (float)(Math.Abs(base.Height - (base.Height - len) * Math.Sin(Math.PI * r / maxValue)));
//g.DrawLine(mypenx1y1x2y2); //刻度线
//g.DrawString(r.ToString()myfontmybrushx2y2);//刻度值
}
x3 = (float)(Math.Abs(base.Width / 2 - (base.Height - len) * Math.Cos(Math.PI * r_hand / maxValue)));
y3 = (float)(Math.Abs(base.Height - (base.Height - len) * Math.Sin(Math.PI * r_hand / maxValue)));
g.DrawLine(mypen2 x3 y3 base.Width / 2 base.Height);//指针
}
int r_hand;
public float Speed
{
get
{
return r_hand;
}
set
{
this.r_hand = (int)(value);
}
}
private void carpanel_Load(object sender EventArgs e)
{
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-04-24 20:11 本科毕业设计\
文件 17934 2015-04-21 12:45 本科毕业设计\数据范围及界面设想.docx
目录 0 2015-04-24 19:20 本科毕业设计\简单的仪表盘\
目录 0 2015-04-24 19:20 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\
文件 2845 2015-04-24 16:01 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\CarPanel.csproj
文件 5814 2015-04-24 19:18 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\CollegeDesign.csproj
文件 488 2015-04-24 19:18 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\CollegeDesign.csproj.user
文件 4212 2015-04-24 19:19 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\Form1.Designer.cs
文件 984 2015-04-24 19:19 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\Form1.cs
文件 5814 2015-04-24 19:19 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\Form1.resx
文件 505 2015-04-24 16:04 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\Program.cs
目录 0 2015-04-24 19:20 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\Properties\
文件 1398 2015-04-24 15:59 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\Properties\AssemblyInfo.cs
文件 2898 2015-04-24 15:59 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\Properties\Resources.Designer.cs
文件 5612 2015-04-24 15:59 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\Properties\Resources.resx
文件 1109 2015-04-24 15:59 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\Properties\Settings.Designer.cs
文件 249 2015-04-24 15:59 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\Properties\Settings.settings
目录 0 2015-04-24 19:20 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\bin\
目录 0 2015-04-24 19:21 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\bin\Debug\
文件 11776 2015-04-24 19:21 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.exe
文件 38400 2015-04-24 19:21 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.pdb
文件 14328 2015-04-24 19:21 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe
文件 490 2009-06-11 05:14 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe.manifest
文件 1521 2015-04-24 16:14 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\carpanel.Designer.cs
文件 2654 2015-04-24 19:01 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\carpanel.cs
文件 5814 2015-04-24 16:14 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\carpanel.resx
目录 0 2015-04-24 19:20 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\obj\
目录 0 2015-04-24 19:21 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\obj\Debug\
文件 180 2015-04-24 19:18 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\obj\Debug\CarPanel.carpanel.resources
文件 180 2015-04-24 19:14 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\obj\Debug\CarPanel.carpanel2.resources
文件 2441 2015-04-24 19:21 本科毕业设计\简单的仪表盘\WindowsFormsApplication2\obj\Debug\CollegeDesign.csproj.FileListAbsolute.txt
............此处省略141个文件信息
- 上一篇:C#.NET考试系统
- 下一篇:在线考试系统-详细设计说明书
相关资源
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
评论
共有 条评论