当前位置: 代码迷 >> C# >> C#通道口程序解读
  详细解决方案

C#通道口程序解读

热度:89   发布时间:2016-05-05 03:49:45.0
C#入口程序解读
namespace CStest{    static class Program    {        /// <summary>        /// 应用程序的主入口点。        /// </summary>        [STAThread]        static void Main()        {            //此方法为应用程序启用可视样式。如果控件和操作系统支持视觉样式,则控件将以视觉样式进行绘制。            //若要使 EnableVisualStyles生效,必须在应用程序中创建任何控件之前调用它;EnableVisualStyles 通常是 Main 函数的第一行            Application.EnableVisualStyles();            //1.在应用程序范围内设置控件显示文本的默认方式(可以设为使用新的GDI+ , 还是旧的GDI)            //true使用GDI+方式显示文本, false使用GDI方式显示文本.            //2.只能在单独运行窗体的程序中调用该方法;不能在插件式的程序中调用该方法;            //3.只能在程序创建任何窗体前调用该方法,否则会引发InvalidOperationException异常            Application.SetCompatibleTextRenderingDefault(false);            //Begins running a standard application message loop on the current thread, and makes the specified form visible.            //用代码可表示为:            //while (GetMessage(&msg) > 0)            //{            //    TranslateMessage(&msg);            //    DispatchMessage(&msg);            //}            Application.Run(new Form1());        }    }}


  相关解决方案