知识要点概括:
1:Minutes to Midnight Countdown (午夜倒计时) 2008-7-30
TimeSpan的用法① String.Format的用法 StringBuilder的用法
ProgressBar控件 WebBrowser控件② Timer控件 MainMenu控件
①
利用TimerSpan计算 天数倒计时
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
DateTime dt1 = new DateTime(2008, 8, 8);
DateTime dt2 = DateTime.Now;
TimeSpan timespan;
private void button1_Click(object sender, EventArgs e)
{
timespan = dt1 - dt2;
MessageBox.Show(Math.Ceiling (timespan.TotalDays).ToString ());
}
}
②
WebBrowser控件用法
webBrowser.DocumentText
Gets or sets the HTML contents of the page displayed in the System.Windows.Forms.WebBrowser control.
StringBuilder sb = new StringBuilder();
//在实例末尾添加指定的字符串
sb.Append(@"<b>Minutes to Midnight Countdown</b>").Append(@"<br/>").Append(@"<br/>");
sb.Append(@"Day 01 application of 30 Days of .NET [Windows Mobile Applications]").Append(@"<br/>");
sb.Append(@"http://www.cjcraft.com/blog/").Append(@"<br/>");
sb.Append(@"<br/>").Append(@"<br/>");
sb.Append(@"<b>Does your company need help with your next, or first, Windows Mobile project.</b> ").Append(@"<br/>").Append(@"<br/>");
sb.Append(@"I'm available for consulting and contracting. ");
sb.Append(@"Feel free to contact me about Windows Mobile device application development. ").Append(@"<br/>").Append(@"<br/>");
sb.Append(@"<a href=""cjcraft@mail.com"">cjcraft@mail.com</a>");
webBrowser.DocumentText = sb.ToString();
③ String。Format用法
参加源代码