program.cs

来自「Microsoft Mobile Development Handbook的代码」· CS 代码 · 共 56 行

CS
56
字号
using System;
using System.Windows.Forms;

namespace CodeForChapter2
{
  static class Program
  {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [MTAThread]
    static void Main()
    {
      //Application.Run(new frmDocListSoftKeys());
      //Application.Run(new frmMenuPlusToolbar());
      //Application.Run(new frmSquare());
      //Application.Run(new frmBaseWithSIP());
      //Application.Run(new frmBrokenChild());
      //Application.Run(new frmMain());
      Application.Run(new frmDockAnchor());
    }

    internal static float ScaleFactor = 1;
  }

  //#region Scaling
  //static class Program
  //{
  //  /// <summary>
  //  /// The main entry point for the application.
  //  /// </summary>
  //  [MTAThread]
  //  static void Main()
  //  {
  //    frmScaling f = new frmScaling();

  //    const float designResolution = 96.0f; //typical
  //    System.Drawing.Graphics g = f.CreateGraphics();
  //    float runningResolution = g.DpiX; //g.DpiY will return the same value
  //    ScaleFactor = runningResolution / designResolution;
  //    g.Dispose();

  //    Application.Run(f);
  //  }

  //  // multiply all custom drawing with Program.ScaleFactor
  //  // most of the time this will have one of 3 values
  //  // 1   , when we designed for exactly what we run on
  //  // 2   , when we designed for 96 dpi but we are running on 192
  //  // 1.365, when we designed for 96 dpi but we are running on 131 (qvga smartphone)
  //  internal static float ScaleFactor;
  //}
  //#endregion
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?