卡西卡的小寶庫
寶庫寶庫寶庫
Showing posts with label WM6. Show all posts
Showing posts with label WM6. Show all posts

Gestures:滑鼠(觸控筆)手勢,用動作來執行命令。

原文網址|摘要:

筆記:

  1. 要先安裝 OpenNETCF Smart Device Framework ( 2.2 Community Edition )
  2. 如果要套用到自己的程式碼
    1. 引用using vbAccelerator.Components.Win32;
      using OpenNETCF.Windows.Forms;
    2. 修改 Main() Application2.Run(new Form1()); // OpenNETCF.Windows.Forms.Application2
    3. form的建構式,InitializeComponent()之後加上 MouseGestureFilter mgf = new MouseGestureFilter();
      Application2.AddMessageFilter(mgf);
      mgf.MouseGesture+=new MouseGestureEventHandler(mgf_MouseGesture);
    4. 加上 mgf_MouseGesture private void mgf_MouseGesture(object sender, MouseGestureEventArgs args) {...}
  3. 可以在DataGrid上使用,但第一個MOUSE_DOWN的事件也會被datagrid收到,CurrentCell會改變。

    Screen02

  4. 雖然可以辨識手勢,但還做不到像TouchFLO的效果。
  5. 若將 args.AcceptGesture = true; 則所有事件都會被吞掉,不會向下傳到其它元件。
  6. 修改過的source[Box.net]

 

另一個Gestures相關的文章:CodeProject: Optimizing Screen Area using Mouse Gestures.

 

問題:DateTime.Today.ToString("yyyy/MM/dd") 的結果一定是"2006/03/05"嗎?

OS: Windows Mobile 6 Professional (ASUS P750)

在「開始\設定\系統\區域設定」中,「中文(台灣的)」的「日期」日曆類型有三種,其中有一個「臺灣曆(中文)」會讓ToString吐出民國年,"97/03/05"!

不正確的日期字串導致不預期的錯誤啊……

Screen23
臺灣曆(中文)
Screen21
97/03/05
Screen19
西曆(英文)
Screen18
2008/03/05

DateTime.Parse 也有相同的情況。