简体   繁体   中英

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.

Your function should be declared as:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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