简体   繁体   English

FontFamily和大小方法

[英]FontFamily and Size Method

im using the following method 即时通讯使用以下方法

  private void FontChange(FontFamily f, int Syze) 
  {
      Font font = new Font ( f , Syze );
  }

then if i want to use the method i call 然后,如果我想使用我调用的方法

FontChange("Consolas",11); 

Which gives me the error: 这给了我错误:

The best overloaded method match for 'ContactList.Main.FontChange(System.Drawing.FontFamily, int)' has some invalid arguments. 与“ ContactList.Main.FontChange(System.Drawing.FontFamily,int)”匹配的最佳重载方法具有一些无效参数。

Your function should be declared as: 您的函数应声明为:

    private void FontChange(string f, int Syze)
    {
        Font font = new Font(f, Syze);
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM