1
所以我在做一個tutorial on C#錯誤與C#GUI代碼
爲覆盆子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#的新手。 任何幫助表示讚賞。