📄 mainform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Text ;
using System.Threading;
using System.Globalization;
using System.Resources;
namespace 窗口编辑器
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class MainForm : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.OpenFileDialog openFileDialog;
private System.Windows.Forms.StatusBar statusBar1;
private System.Windows.Forms.StatusBarPanel statusBarPanel1;
private System.Windows.Forms.StatusBarPanel statusBarPanel2;
private System.Windows.Forms.MenuItem menuItem5;
private System.Windows.Forms.MenuItem miFile;
private System.Windows.Forms.MenuItem miNew;
private System.Windows.Forms.MenuItem miOpen;
private System.Windows.Forms.MenuItem miExit;
private System.Windows.Forms.MenuItem miCheck;
private System.Windows.Forms.MenuItem miHelp;
private System.Windows.Forms.ToolBar toolBar;
private System.Windows.Forms.ToolBarButton tbnNew;
private System.Windows.Forms.ToolBarButton tbnOpen;
private System.Windows.Forms.ToolBarButton tbnSave;
private System.Windows.Forms.ToolBarButton tbnSeparator;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.ContextMenu contextMenu1;
private System.Windows.Forms.MenuItem miSave;
private System.Windows.Forms.MenuItem miSaveAs;
private System.Windows.Forms.MenuItem miPra;
private System.Windows.Forms.MenuItem conNew;
private System.Windows.Forms.MenuItem conOpen;
private System.Windows.Forms.MenuItem conExit;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.MenuItem conSave;
private System.Windows.Forms.MenuItem chCascade;
private System.Windows.Forms.MenuItem chTileHorizontal;
private System.Windows.Forms.MenuItem chTileVertical;
private System.Windows.Forms.MenuItem chArrangeIcons;
private System.Windows.Forms.MenuItem conCascade;
private System.Windows.Forms.MenuItem conTileHorizontal;
private System.Windows.Forms.MenuItem miPreview;
private System.Windows.Forms.MenuItem miH;
private System.Windows.Forms.MenuItem miMake;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.MenuItem miLanguage;
private System.Windows.Forms.MenuItem miSimpleChinese;
private System.Windows.Forms.MenuItem miEnglish;
ResourceManager rm;
private System.Windows.Forms.MenuItem miWindows;
private System.Windows.Forms.Timer timer1;
public System.Windows.Forms.Timer timer;
private System.Windows.Forms.StatusBarPanel statusBarPanel3;
string[] args=null;
public MainForm()
{
//
// Windows 窗体设计器支持所必需的
//
// 根据 程序配置来 设置区域性
string lang = GetLanguage(); // 取得当前配置语言
if (lang != null && lang != "")
Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
/* 根据控制面板设置 区域性
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
*/
// 创建资源管理器实例
rm = new ResourceManager("窗口编辑器.Resource",System.Reflection.Assembly.GetExecutingAssembly());
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
public MainForm(string[] args):this()
{
this.args =args;
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components);
this.miFile = new System.Windows.Forms.MenuItem();
this.miNew = new System.Windows.Forms.MenuItem();
this.miOpen = new System.Windows.Forms.MenuItem();
this.miExit = new System.Windows.Forms.MenuItem();
this.menuItem5 = new System.Windows.Forms.MenuItem();
this.miSave = new System.Windows.Forms.MenuItem();
this.miSaveAs = new System.Windows.Forms.MenuItem();
this.miPra = new System.Windows.Forms.MenuItem();
this.miCheck = new System.Windows.Forms.MenuItem();
this.miPreview = new System.Windows.Forms.MenuItem();
this.miWindows = new System.Windows.Forms.MenuItem();
this.chCascade = new System.Windows.Forms.MenuItem();
this.chTileHorizontal = new System.Windows.Forms.MenuItem();
this.chTileVertical = new System.Windows.Forms.MenuItem();
this.chArrangeIcons = new System.Windows.Forms.MenuItem();
this.miHelp = new System.Windows.Forms.MenuItem();
this.miH = new System.Windows.Forms.MenuItem();
this.miMake = new System.Windows.Forms.MenuItem();
this.miLanguage = new System.Windows.Forms.MenuItem();
this.miSimpleChinese = new System.Windows.Forms.MenuItem();
this.miEnglish = new System.Windows.Forms.MenuItem();
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
this.statusBar1 = new System.Windows.Forms.StatusBar();
this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel3 = new System.Windows.Forms.StatusBarPanel();
this.toolBar = new System.Windows.Forms.ToolBar();
this.tbnNew = new System.Windows.Forms.ToolBarButton();
this.tbnOpen = new System.Windows.Forms.ToolBarButton();
this.tbnSave = new System.Windows.Forms.ToolBarButton();
this.tbnSeparator = new System.Windows.Forms.ToolBarButton();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.contextMenu1 = new System.Windows.Forms.ContextMenu();
this.conNew = new System.Windows.Forms.MenuItem();
this.conOpen = new System.Windows.Forms.MenuItem();
this.conExit = new System.Windows.Forms.MenuItem();
this.conSave = new System.Windows.Forms.MenuItem();
this.conCascade = new System.Windows.Forms.MenuItem();
this.conTileHorizontal = new System.Windows.Forms.MenuItem();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.timer = new System.Windows.Forms.Timer(this.components);
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
this.SuspendLayout();
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.miFile,
this.miWindows,
this.miHelp,
this.miLanguage});
resources.ApplyResources(this.mainMenu1, "mainMenu1");
//
// miFile
//
resources.ApplyResources(this.miFile, "miFile");
this.miFile.Index = 0;
this.miFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.miNew,
this.miOpen,
this.miExit,
this.menuItem5,
this.miSave,
this.miSaveAs,
this.miPra,
this.miCheck,
this.miPreview});
this.miFile.Popup += new System.EventHandler(this.miFile_Popup);
//
// miNew
//
resources.ApplyResources(this.miNew, "miNew");
this.miNew.Index = 0;
this.miNew.Click += new System.EventHandler(this.miNew_Click);
//
// miOpen
//
resources.ApplyResources(this.miOpen, "miOpen");
this.miOpen.Index = 1;
this.miOpen.Click += new System.EventHandler(this.miOpen_Click);
//
// miExit
//
resources.ApplyResources(this.miExit, "miExit");
this.miExit.Index = 2;
this.miExit.Click += new System.EventHandler(this.miExit_Click);
//
// menuItem5
//
resources.ApplyResources(this.menuItem5, "menuItem5");
this.menuItem5.Index = 3;
//
// miSave
//
resources.ApplyResources(this.miSave, "miSave");
this.miSave.Index = 4;
this.miSave.Click += new System.EventHandler(this.miSave_Click);
//
// miSaveAs
//
resources.ApplyResources(this.miSaveAs, "miSaveAs");
this.miSaveAs.Index = 5;
//
// miPra
//
resources.ApplyResources(this.miPra, "miPra");
this.miPra.Index = 6;
//
// miCheck
//
resources.ApplyResources(this.miCheck, "miCheck");
this.miCheck.Index = 7;
this.miCheck.Click += new System.EventHandler(this.menuItem7_Click);
//
// miPreview
//
resources.ApplyResources(this.miPreview, "miPreview");
this.miPreview.Index = 8;
//
// miWindows
//
resources.ApplyResources(this.miWindows, "miWindows");
this.miWindows.Index = 1;
this.miWindows.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.chCascade,
this.chTileHorizontal,
this.chTileVertical,
this.chArrangeIcons});
this.miWindows.MergeOrder = 4;
this.miWindows.Popup += new System.EventHandler(this.miWindows_Popup);
//
// chCascade
//
resources.ApplyResources(this.chCascade, "chCascade");
this.chCascade.Index = 0;
this.chCascade.Click += new System.EventHandler(this.chCascade_Click);
//
// chTileHorizontal
//
resources.ApplyResources(this.chTileHorizontal, "chTileHorizontal");
this.chTileHorizontal.Index = 1;
this.chTileHorizontal.Click += new System.EventHandler(this.thTileHorizontal_Click);
//
// chTileVertical
//
resources.ApplyResources(this.chTileVertical, "chTileVertical");
this.chTileVertical.Index = 2;
this.chTileVertical.Click += new System.EventHandler(this.chTileVertical_Click);
//
// chArrangeIcons
//
resources.ApplyResources(this.chArrangeIcons, "chArrangeIcons");
this.chArrangeIcons.Index = 3;
this.chArrangeIcons.Click += new System.EventHandler(this.chArrangeIcons_Click);
//
// miHelp
//
resources.ApplyResources(this.miHelp, "miHelp");
this.miHelp.Index = 2;
this.miHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.miH,
this.miMake});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -