資源簡(jiǎn)介
簡(jiǎn)單的c#程序?qū)崿F(xiàn)滿天星,美觀大方,初學(xué)者,一看就懂了,主要用了panle控件。加上一些簡(jiǎn)單的數(shù)組知識(shí),

代碼片段和文件信息
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?Case03_4
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????const?int?s_pinlen?=?100;????????//時(shí)針
????????const?int?m_pinlen?=?75;?????????//分針
????????const?int?h_pinlen?=?50;?????????//秒針
????????private?void?myClock(int?h?int?m?int?s)
????????{
????????????Graphics?myGraphics?=?pictureBox1.CreateGraphics();??????????//創(chuàng)建Graphics對(duì)象實(shí)例
????????????myGraphics.Clear(Color.White);???????????????????????????????//設(shè)置背景色為白色
????????????Pen?myPen?=?new?Pen(Color.Black?1);?????????????????????????//設(shè)置畫筆的顏色和寬度
????????????myGraphics.DrawEllipse(myPen?pictureBox1.ClientRectangle);????//繪制橢圓
????????????Point?CPoint?=?new?Point(pictureBox1.ClientRectangle.Width?/?2?pictureBox1.ClientRectangle.Height?/?2);
????????????Point?SPoint?=?new?Point((int)(CPoint.X?+?(Math.Sin(6?*?s?*?Math.PI?/?180))?*?s_pinlen)?(int)(CPoint.Y?-?(Math.Cos(6?*?s?*?Math.PI?/?180))?*?s_pinlen));
????????????Point?MPoint?=?new?Point((int)(CPoint.X?+?(Math.Sin(6?*?m?*?Math.PI?/?180))?*?m_pinlen)?(int)(CPoint.Y?-?(Math.Cos(6?*?m?*?Math.PI?/?180))?*?m_pinlen));
????????????Point?HPoint?=?new?Point((int)(CPoint.X?+?(Math.Sin(((30?*?h)?+?(m?/?2))?*?Math.PI?/?180))?*?h_pinlen)?(int)(CPoint.Y?-?(Math.Cos(((30?*?h)?+?(m?/?2))?*?Math.PI?/?180))?*?h_pinlen));
????????????myGraphics.DrawLine(myPen?CPoint?SPoint);????????//繪制直線
????????????myPen?=?new?Pen(Color.Black?2);
????????????myGraphics.DrawLine(myPen?CPoint?MPoint);
????????????myPen?=?new?Pen(Color.Black?4);
????????????myGraphics.DrawLine(myPen?CPoint?HPoint);
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????this.timer1.Enabled?=?true;
????????}
????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????int?h?=?DateTime.Now.Hour;
????????????int?m?=?DateTime.Now.Minute;
????????????int?s?=?DateTime.Now.Second;
????????????myClock(h?m?s);
????????????this.Text?=?“現(xiàn)在的時(shí)間是:“?+?h.ToString()?+?“:“?+?m.ToString()?+?“:“?+?s.ToString();
????????}
????}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????????914??2008-06-06?21:44??Case03_4\Case03_4.sln
?????文件???????16384??2008-06-06?22:32??Case03_4\Case03_4.suo
?????目錄???????????0??2015-07-11?14:56??Case03_4\Case03_4\
?????目錄???????????0??2015-07-11?14:56??Case03_4\Case03_4\bin\
?????目錄???????????0??2015-07-11?14:56??Case03_4\Case03_4\bin\Debug\
?????文件???????12288??2008-06-06?22:02??Case03_4\Case03_4\bin\Debug\Case03_4.exe
?????文件???????26112??2008-06-06?22:02??Case03_4\Case03_4\bin\Debug\Case03_4.pdb
?????文件???????14328??2008-06-06?22:25??Case03_4\Case03_4\bin\Debug\Case03_4.vshost.exe
?????文件?????????490??2007-07-21?01:33??Case03_4\Case03_4\bin\Debug\Case03_4.vshost.exe.manifest
?????文件????????3762??2008-06-06?21:59??Case03_4\Case03_4\Case03_4.csproj
?????文件????????2406??2008-06-06?22:02??Case03_4\Case03_4\Form1.cs
?????文件???????11687??2008-06-06?21:55??Case03_4\Case03_4\Form1.Designer.cs
?????文件????????6008??2008-06-06?21:55??Case03_4\Case03_4\Form1.resx
?????目錄???????????0??2015-07-11?14:56??Case03_4\Case03_4\obj\
?????目錄???????????0??2015-07-11?14:56??Case03_4\Case03_4\obj\Debug\
?????文件?????????995??2008-06-06?22:25??Case03_4\Case03_4\obj\Debug\Case03_4.csproj.FileListAbsolute.txt
?????文件?????????847??2008-06-06?21:59??Case03_4\Case03_4\obj\Debug\Case03_4.csproj.GenerateResource.Cache
?????文件???????12288??2008-06-06?22:02??Case03_4\Case03_4\obj\Debug\Case03_4.exe
?????文件?????????180??2008-06-06?22:00??Case03_4\Case03_4\obj\Debug\Case03_4.Form1.resources
?????文件???????26112??2008-06-06?22:02??Case03_4\Case03_4\obj\Debug\Case03_4.pdb
?????文件?????????180??2008-06-06?22:00??Case03_4\Case03_4\obj\Debug\Case03_4.Properties.Resources.resources
?????目錄???????????0??2008-06-06?21:44??Case03_4\Case03_4\obj\Debug\TempPE\
?????文件?????????489??2008-06-06?21:44??Case03_4\Case03_4\Program.cs
?????目錄???????????0??2015-07-11?14:56??Case03_4\Case03_4\Properties\
?????文件????????1372??2008-06-06?21:44??Case03_4\Case03_4\Properties\AssemblyInfo.cs
?????文件????????2866??2008-06-06?21:44??Case03_4\Case03_4\Properties\Resources.Designer.cs
?????文件????????5612??2008-06-06?21:44??Case03_4\Case03_4\Properties\Resources.resx
?????文件????????1093??2008-06-06?21:44??Case03_4\Case03_4\Properties\Settings.Designer.cs
?????文件?????????249??2008-06-06?21:44??Case03_4\Case03_4\Properties\Settings.settings
- 上一篇:圖像清晰度評(píng)價(jià)
- 下一篇:24路舵機(jī)控制板C#源碼
評(píng)論
共有 條評(píng)論