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

84 lines
2.2 KiB

using Leit.StationFunction;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MirrorBox
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
ServiceData.PlcServiceInit();
ServiceData.ServiceDataInit();
ServiceData.WorkStationInit();
ServiceData.StationTimer();
}
private void Form1_Load(object sender, EventArgs e)
{
this.BeginInvoke(new Action(() => {
this.Hide();
}));
}
private void ToolStripMenuItem_Exit_Click(object sender, EventArgs e)
{
this.Close();
}
private void ToolStripMenuItem_Version_Click(object sender, EventArgs e)
{
this.Show();
this.WindowState = FormWindowState.Normal;
this.Activate();
}
private void notifyIcon_Main_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.Show();
this.WindowState = FormWindowState.Normal;
this.Activate();
}
private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Hide();
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
notifyIcon_Main.Visible = false;
//if (MessageBox.Show("你确定要退出程序吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK)
//{
// notifyIcon_Main.Visible = false;
// e.Cancel = false;
//}
//else
//{
// notifyIcon_Main.Visible = true;
// e.Cancel = true;
//}
}
private void HToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}