【问题标题】:Error with C# GUI CodeC# GUI 代码错误
【发布时间】:2015-10-10 00:02:50
【问题描述】:

所以我在做一个tutorial on C#

对于树莓派。他们有一张 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' takes0' 参数没有重载 /usr/lib/mono/2.0/System.Windows.Forms.dll(与先前错误相关的符号位置) 编译失败:1 个错误,0 个警告

谁能告诉我这段代码有什么问题。我也是 C# 的新手。 任何帮助表示赞赏。

【问题讨论】:

    标签: c# user-interface mono


    【解决方案1】:

    查看 MSDN 文档here

    试试

    Application.SetCompatibleTextRenderingDefault(false);
    

    【讨论】:

      猜你喜欢
      • 2022-11-27
      • 2023-03-31
      • 1970-01-01
      • 2016-05-30
      • 2012-04-11
      • 1970-01-01
      • 2016-10-15
      • 2013-11-23
      • 1970-01-01
      相关资源
      最近更新 更多