MyToolkit新增一個專案 選擇<Windows Form控制項程式庫 加入一個Label元件
Set the BorderStyle to FixedSingle.
Set the Text to the digit 0 (zero).
Set the Autosize to False.
Set the Size to 30, 20.
Set the TextAlign to MiddleCenter.
Set the BorderStyle to FixedSingle.
Set the Text to the digit 0 (zero).
Set the Autosize to False.
Set the Size to 30, 20.
Set the TextAlign to MiddleCenter.




1: public sealed class tictoc
2: {3: private DateTime startTime;
4: private static tictoc manager; // Singleton物件: tictoc類別的唯一物件
5: // 靜態建構子
6: static tictoc()
7: { 8: 9: }10: // 預設建構子
11: private tictoc()
12: { 13: startTime = DateTime.Now; 14: }15: // 靜態方法
16: public static tictoc Instance
17: { 18: get 19: {20: if (manager == null)
21: {22: manager = new tictoc();// 呼叫預設建構子並初始化startTime
23: }24: return manager;
25: } 26: }
1: #region 設定滑鼠位置
2: [DllImport("user32.dll")]
3: public static extern bool SetCursorPos(int x, int y);
4: #endregion
5: #region 模擬滑鼠事件
6: [DllImport("user32.dll")]
7: public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
8: public const int MOUSEEVENTF_LEFTDOWN = 0x02;
9: public const int MOUSEEVENTF_LEFTUP = 0x04;
10: #endregion
