我有一个名为 hellowf.cs 的文件
class MyFirstApp {
static void Main() {
System.Windows.Forms.MessageBox.Show("Hello, Mono+WinForms!");
}
}
在 Ubuntu 8.10 上,我执行以下操作
gmcs hellowf.cs -r:System.Drawing.dll -r:System.Windows.Forms.dll
mono hellowf.exe
...它看起来像这样:
alt text http://img136.imageshack.us/img136/4674/helloproblemuk5.png
消息的第二部分丢失了。为什么会这样?相同的二进制文件 - hellowf.exe - 在 Windows 上运行良好。
更新: 这真的很烦人。到目前为止,这是我拥有并尝试使这项工作成功的单声道版本:
1.9.1 (from official ubuntu repo)
2.0.1 (from some some 3rd party repo)
2.2 (wiped every mono pkg and compiled myself)
我当前的单声道版本:
mono --version
Mono JIT compiler version 2.2 (tarball Wed Jan 14 22:58:21 CET 2009)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
gmcs --version
Mono C# compiler version 2.2.0.0
...有什么线索吗?
最佳答案
我终于找到了解决方法。这似乎是 Mono 中与字体渲染相关的错误。当打开“Full”提示时会发生这种情况。我通常是这样的。在 System->Preferences->Appearance->Fonts->Details
中将其更改为“Slight”或“Medium”可解决此问题。感谢您的帮助!
关于C# Mono+Winforms MessageBox问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/443737/