推荐:NetCF秒表 透明界面,可更换背景,精确到毫秒级

lvlingwy 2010-04-27 05:10:45
适用于 Windows mobile 手机 svag屏幕(800*480),其它分辨率未做测试;

测试机器:HTC HD2 手机 需要 :NET Compact Framework 支持运行 下载地址名称: NetCF秒表

特点:

1、透明界面,支持更换背景图片(准备800*480的背景图替换到程序的Resources文件夹内即可)

2、精确到毫秒级 最大范围999个小时

3、计时类别可以 按次记录(同时记录多个人的时间) 和 按圈记录 (分别记录每一圈所用的时间)

4、记录数不受限制,理论可以记录N次哈

5、计时结束后,支持手指滑动屏幕进行记录查阅

本人的手机处女作品,欢迎大家测试,并反馈意见!

下载地址:下载

...全文
666 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
绿领巾童鞋 2012-05-02
  • 打赏
  • 举报
回复
TransparentControl GOOGLE一下就有惊喜
wcchboy 2010-07-22
  • 打赏
  • 举报
回复
不要全部的给些主要的吧 谢谢你拉
wcchboy 2010-07-22
  • 打赏
  • 举报
回复
界面这么好看给个代码吧
lvlingwy 2010-05-06
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 egmkang 的回复:]
精确到ms级,扯蛋
[/Quote]
为什么这么说?
egmkang 2010-05-04
  • 打赏
  • 举报
回复
精确到ms级,扯蛋
88csdn 2010-05-04
  • 打赏
  • 举报
回复
呵呵,支持一下
ginpq 2010-05-01
  • 打赏
  • 举报
回复
没源码不下
blingbling0227 2010-04-30
  • 打赏
  • 举报
回复
给个源码下载吧 嘿嘿
thestronger 2010-04-30
  • 打赏
  • 举报
回复
非常漂亮
lvlingwy 2010-04-30
  • 打赏
  • 举报
回复


using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TransparentControl;

namespace NFStopWatch2
{
public partial class headshow : TransPanel
{
private TransLabel h_lbl, m_lbl, s_lbl, mi_lbl;
public headshow(int alpha,Bitmap headbj,Bitmap lblbj)
{
this.Alpha = alpha;
this.BackGroundImage = headbj;
InitializeComponent();
int left=15;
h_lbl = new TransLabel();
h_lbl.Width = 115;
h_lbl.Left = left;
h_lbl.Top = 20;
this.Controls.Add(h_lbl);

TransLabel t1_lbl = new TransLabel();
t1_lbl.Width = 15;
t1_lbl.Left = left + h_lbl.Width;
t1_lbl.Top = 15;
t1_lbl.Text = ":";
this.Controls.Add(t1_lbl);

m_lbl = new TransLabel();
m_lbl.Width = 80;
m_lbl.Left = left + h_lbl.Width + t1_lbl.Width;
m_lbl.Top = 20;
this.Controls.Add(m_lbl);

TransLabel t2_lbl = new TransLabel();
t2_lbl.Width = 15;
t2_lbl.Left = left + h_lbl.Width + t1_lbl.Width + m_lbl.Width;
t2_lbl.Top = 15;
t2_lbl.Text = ":";
this.Controls.Add(t2_lbl);

s_lbl = new TransLabel();
s_lbl.Width = 80;
s_lbl.Left = left + h_lbl.Width + t1_lbl.Width + m_lbl.Width + t2_lbl.Width;
s_lbl.Top = 20;
this.Controls.Add(s_lbl);

TransLabel t3_lbl = new TransLabel();
t3_lbl.Width = 15;
t3_lbl.Left = left + h_lbl.Width + t1_lbl.Width + m_lbl.Width + t2_lbl.Width + s_lbl.Width;
t3_lbl.Top = 15;
t3_lbl.Text = ".";
this.Controls.Add(t3_lbl);

mi_lbl = new TransLabel();
mi_lbl.Width = 80;
mi_lbl.Left = left + h_lbl.Width + t1_lbl.Width + m_lbl.Width + t2_lbl.Width + s_lbl.Width + t3_lbl.Width + 3;
mi_lbl.Height = 50;
mi_lbl.Font = new Font("Tahoma", 16, FontStyle.Regular);
mi_lbl.ForeColor = Color.White;
mi_lbl.TextAlign = ContentAlignment.TopCenter;
mi_lbl.Top = 40;
this.Controls.Add(mi_lbl);


foreach (Control ctl in this.Controls)
{
TransLabel tlbl = ctl as TransLabel;
if (tlbl != null && tlbl!=mi_lbl)
{
tlbl.Height = 80;
tlbl.Font = new Font("Tahoma", 25, FontStyle.Regular);
tlbl.ForeColor = Color.White;
tlbl.TextAlign = ContentAlignment.TopCenter;
tlbl.Alpha = alpha;
tlbl.BackGroundImage = lblbj;
}
}
TimeInit();
}
public void TimeInit()
{
h_lbl.Text = "000";
m_lbl.Text = "00";
s_lbl.Text = "00";
mi_lbl.Text = "000";
}
public void SetTime(TimeSpan ts)
{
int hnum = ts.Days * 24 + ts.Hours;
mi_lbl.Text = ts.Milliseconds.ToString("000");
s_lbl.Text = ts.Seconds.ToString("00");
m_lbl.Text = ts.Minutes.ToString("00");
h_lbl.Text = hnum.ToString("000");
}

protected override void OnPaint(PaintEventArgs pe)
{
// TODO: 在此处添加自定义绘制代码

// Calling the base class OnPaint
base.OnPaint(pe);
}
}
}


lvlingwy 2010-04-30
  • 打赏
  • 举报
回复

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TransparentControl;

namespace NFStopWatch2
{
public partial class listshow_tc : TransLabel
{
TransPanel tp;
public listshow_tc()
{
InitializeComponent();
}
protected override void OnMouseDown(MouseEventArgs e)
{
tp = this.Parent as TransPanel;
if (tp != null)
{
MouseEventArgs me = new MouseEventArgs(e.Button, 1, e.X + this.Left, e.Y + this.Top, 0);
tp.OnMouseDown_p(me);
}
//base.OnMouseDown(e);
}
protected override void OnMouseUp(MouseEventArgs e)
{
tp = this.Parent as TransPanel;
if (tp != null)
{
MouseEventArgs me = new MouseEventArgs(e.Button, 1, e.X + this.Left, e.Y + this.Top, 0);
tp.OnMouseUp_p(me);
}
//base.OnMouseUp(e);
}
protected override void OnMouseMove(MouseEventArgs e)
{
tp = this.Parent as TransPanel;
if (tp != null)
{
MouseEventArgs me = new MouseEventArgs(e.Button, 1, e.X + this.Left, e.Y + this.Top, 0);
tp.OnMouseMove_p(me);
}
//base.OnMouseMove(e);
}
protected override void OnClick(EventArgs e)
{
tp = this.Parent as TransPanel;
if (tp != null)
{
tp.OnClick_p(e);
}
//base.OnClick(e);
}
protected override void OnPaint(PaintEventArgs pe)
{
// TODO: 在此处添加自定义绘制代码

// Calling the base class OnPaint
base.OnPaint(pe);
}
}
}


lvlingwy 2010-04-30
  • 打赏
  • 举报
回复
真晕,你们干嘛不下载试试呢,就说没思路,东西我都摆这里了。好,给你们一段代码看

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TransparentControl;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace NFStopWatch2
{
public partial class StopWatch : TransForm
{
private int tnum = 0;
private int jsnum = 0;
private string typestr = "c";
private int ph = 48;
private headshow headshow1;
private listshow_tc listshow;
// private TransControl tstop_btn;
Stopwatch sw = new Stopwatch();
TimeSpan last_ts = TimeSpan.FromMilliseconds(0);
private Bitmap bm_zzbj;
private Bitmap bm_toolbj;
private Bitmap bm_sjshowbj1;
private Bitmap bm_sjshowbj2;
private Bitmap bm_showbj;
private Bitmap bm_jsbtn1;
private Bitmap bm_jsbtn2;
private Bitmap bm_typebtn1;
private Bitmap bm_typebtn2;

[DllImport("CoreDll.dll")]
private static extern void SystemIdleTimerReset();

public StopWatch()
{
bm_zzbj = new Bitmap(this.SysPath + "\\Resources\\zzbj.jpg");
bm_toolbj = new Bitmap(NFStopWatch2.Properties.Resources.toolbj);
bm_sjshowbj1 = new Bitmap(NFStopWatch2.Properties.Resources.sjshowbj1);
bm_sjshowbj2 = new Bitmap(NFStopWatch2.Properties.Resources.sjshowbj2);
bm_showbj = new Bitmap(NFStopWatch2.Properties.Resources.showbj);
bm_jsbtn1 = new Bitmap(NFStopWatch2.Properties.Resources.jsbtn1);
bm_jsbtn2 = new Bitmap(NFStopWatch2.Properties.Resources.jsbtn2);
bm_typebtn1 = new Bitmap(NFStopWatch2.Properties.Resources.typebtn1);
bm_typebtn2 = new Bitmap(NFStopWatch2.Properties.Resources.typebtn2);

this.BackGroundImage = bm_zzbj;
InitializeComponent();
toolpanel.Alpha = 255;
toolpanel.BackGroundImage = bm_toolbj;
headshow1 = new NFStopWatch2.headshow(60, bm_sjshowbj1, bm_sjshowbj2);
headshow1.Location = new System.Drawing.Point(24, 22);
headshow1.Size = new System.Drawing.Size(430, 115);
transPanel1.Controls.Add(headshow1);

tstop_btn.Image = bm_jsbtn1;
type_btn.Image = bm_typebtn2;
//tstop_btn = new TransControl();
//tstop_btn.Width = 151;
//tstop_btn.Height = 79;
//tstop_btn.Left = 310;
//tstop_btn.Top = 12;
//tstop_btn.BackGroundImage = bm_jsbtn;
//toolpanel.Controls.Add(tstop_btn);
//tstop_btn.Click += new EventHandler(tstop_btn_Click);
init();
}

private void init()
{
sw.Reset();
heartimer.Enabled = false;
listpanel.Controls.Clear();
last_ts = TimeSpan.FromMilliseconds(0);
tnum = 0;
jsnum = 0;
type_btn.Enabled = true;
tstop_btn.Enabled = false;
start_mi.Enabled = true;
start_mi.Text = "开始";
headshow1.TimeInit();
}

private void start()
{
if (!sw.IsRunning)
{
sw.Start();
heartimer.Enabled = true;
type_btn.Enabled = false;
tstop_btn.Enabled = true;
start_mi.Text = "停止";
listpanel.ScrollEnable = false;
}
}
private void stop()
{
if (sw.IsRunning)
{
sw.Stop();
heartimer.Enabled = false;
tstop_btn.Enabled = false;
start_mi.Enabled = false;
listpanel.ScrollEnable = true;
}
}
private void t_js()
{
TimeSpan tts = TimeSpan.FromMilliseconds(sw.ElapsedMilliseconds);
TimeSpan ts = tts;
if (typestr == "q" && last_ts.Milliseconds > 0)
{
ts = tts - last_ts;
}
foreach (Control ctl in listpanel.Controls)
{
TransLabel tl = ctl as TransLabel;
if (tl != null)
tl.Top = tl.Top + ph + 4;
}
listshow = new listshow_tc();
listshow.Parent = listpanel;
listshow.Width = listpanel.Width - 55;
listshow.Height = ph;
listshow.Top = 0;// ph * tnum + 4 * tnum;
listshow.Left = 26;
listshow.ForeColor = Color.White;
listshow.Font = new Font("Tahoma", 13, FontStyle.Regular);
listshow.Text = String.Format(" {0} {1}:{2:00}:{3:00}.{4:000}", (tnum + 1).ToString().PadLeft(3, ' '), (ts.Days * 24 + ts.Hours).ToString().PadLeft(3, ' '), ts.Minutes, ts.Seconds, ts.Milliseconds);
listshow.Alpha = 60;
listshow.BackGroundImage = bm_showbj;
listpanel.Controls.Add(listshow);

last_ts = tts;
tnum++;
}



private void heartimer_Tick(object sender, EventArgs e)
{
if (sw.IsRunning)
{
TimeSpan ts = TimeSpan.FromMilliseconds(sw.ElapsedMilliseconds);
int hnum = ts.Days * 24 + ts.Hours;
if (hnum > 999)
{
stop();
MessageBox.Show("超过最大时长");
return;
}
else
{
headshow1.SetTime(ts);
}
jsnum++;
if (jsnum >= 15000)
{
SystemIdleTimerReset();
jsnum = 0;
}
}
}

private void reset_mi_Click(object sender, EventArgs e)
{
init();
}

private void start_mi_Click(object sender, EventArgs e)
{
if (sw.IsRunning)
{
stop();
t_js();
}
else
{
start();
}
}

private void tstop_btn_Click(object sender, EventArgs e)
{
t_js();
}

private void tstop_btn_MouseDown(object sender, MouseEventArgs e)
{
tstop_btn.Image = bm_jsbtn2;
}

private void tstop_btn_MouseUp(object sender, MouseEventArgs e)
{
tstop_btn.Image = bm_jsbtn1;
}

private void type_btn_Click(object sender, EventArgs e)
{
if (typestr == "c")
{
typestr = "q";
type_btn.Image = bm_typebtn1;
}
else
{
typestr = "c";
type_btn.Image = bm_typebtn2;
}
} }
}



因为还有些疑问未解决,请高手指点一下。
Joe-xXx 2010-04-28
  • 打赏
  • 举报
回复
广而告之,没有什么代码或思路之类的~~
V-Far 2010-04-28
  • 打赏
  • 举报
回复
超,我觉得#2说的很对.就是广告
feishanm 2010-04-28
  • 打赏
  • 举报
回复
同感……
世外涛缘 2010-04-28
  • 打赏
  • 举报
回复
没代码,让人怀疑是广告贴。
beyondma 2010-04-27
  • 打赏
  • 举报
回复
如果你把代码贴上来我就加精了呵呵。

7,655

社区成员

发帖
与我相关
我的任务
社区描述
Windows Phone是微软发布的一款手机操作系统,它将微软旗下的Xbox LIVE游戏、Zune音乐与独特的视频体验整合至手机中。
社区管理员
  • Windows客户端开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧