我使用monodevelop編譯我的應用程序。並嘗試在Linux上使用單聲道運行。看來System.Windows.Forms.Timer對象的刻度事件從不會觸發。System.Windows.Forms.Timer事件在單聲道下運行時根本不會觸發
它在Windows上沒有問題,但在Linux中沒有問題。
相關的代碼大致是這樣的:
// derived from a From
//...
private Timer controlTimer;
//....
protected override OnCreateControl(/*...*/)
{
//,,,
controlTimer=new Timer();
controlTimer.Tick += new EventHandler(controlFunc);
controlTimer.Interval = 40;
controlTimer.Tag = this; // The form is used by the callback
controlTimer.Start();
//...
}
//....
這是什麼版本的單聲道?類似的代碼在這裏工作正常... – Gonzalo 2009-11-19 15:34:35
$ mono -V 單聲道JIT編譯器版本2.4.2.3(Debian 2.4.2.3 + dfsg-2) 版權所有(C)2002-2008 Novell,Inc和Contributors。 www.mono-project.com \t TLS:__thread \t GC:包括伯姆(有類型的GC) \t SIGSEGV:altstack \t聲明:epoll的 \t架構:86 \t禁用:無 – Calmarius 2009-11-20 11:10:33