You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VersionUpadate;
namespace MCRun
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
InitFormSize();
Mesnac.Gui.Run.Global.AppConfigHandler.SysConfigMenuCommand.Instance.Run("Main", this.panel1);
}
private void InitFormSize()
{
int width=0;
int height=0;
try
{
width = Convert.ToInt32(config.GetConfigValue("FormWidth"));
height = Convert.ToInt32(config.GetConfigValue("FormHeight"));
}
catch
{
}
if (width > 0 && height > 0)
{
this.Size = new System.Drawing.Size(width, height);
}
}
private void 退ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
int width = this.Size.Width;
int height = this.Size.Height;
try
{
config.SetConfigValue("FormWidth", width.ToString());
config.SetConfigValue("FormHeight", height.ToString());
MessageBox.Show("尺寸设置成功!");
}
catch
{
MessageBox.Show("尺寸设置失败!");
}
}
}
}