C# GUI 代码错误
Error with C# GUI Code
所以我在做 tutorial on C#
为 raspberry pi。他们有 C# 代码的图像,但图像的一部分被截掉了,所以我不知道它之后会发生什么。
这是我使用的代码:
using System;
using System.Windows.Forms;
using System.Drawing;
class Program {
public static void Main(string[] args) {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault();
var f=new Form();
f.SetBounds(0,0,100,100);
Application.Run(f);
}
}
我认为问题出在这一行:
Application.SetCompatibleTextRenderingDefault();
因为这是我得到的错误:
test.cs(10,15):错误 CS1501:方法 SetCompatibleTextRenderingDefault' takes
0' 参数没有重载
/usr/lib/mono/2.0/System.Windows.Forms.dll(与上一个错误相关的符号位置)
编译失败:1 个错误,0 个警告
有人能告诉我这段代码有什么问题吗?我也是 C# 的新手。
感谢任何帮助。
查看 MSDN 文档here
尝试
Application.SetCompatibleTextRenderingDefault(false);
所以我在做 tutorial on C#
为 raspberry pi。他们有 C# 代码的图像,但图像的一部分被截掉了,所以我不知道它之后会发生什么。 这是我使用的代码:
using System;
using System.Windows.Forms;
using System.Drawing;
class Program {
public static void Main(string[] args) {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault();
var f=new Form();
f.SetBounds(0,0,100,100);
Application.Run(f);
}
}
我认为问题出在这一行:
Application.SetCompatibleTextRenderingDefault();
因为这是我得到的错误:
test.cs(10,15):错误 CS1501:方法 SetCompatibleTextRenderingDefault' takes
0' 参数没有重载
/usr/lib/mono/2.0/System.Windows.Forms.dll(与上一个错误相关的符号位置)
编译失败:1 个错误,0 个警告
有人能告诉我这段代码有什么问题吗?我也是 C# 的新手。 感谢任何帮助。
查看 MSDN 文档here
尝试
Application.SetCompatibleTextRenderingDefault(false);