FrmSetPlus - 复制.cs
3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using Asa.FaceControl;
using BLL;
using Model;
using SmartScan.PlusSettingFrm;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace SmartScan
{
public partial class FrmSetPlus2 : System.Windows.Forms.Form
{
private readonly Dictionary<FaceButton, Model.ISetMenu> menu = new();
public FrmSetPlus2()
{
InitializeComponent();
return;
//Language.SetLanguage(this);
// this.SizeChanged += FrmSetPlus_SizeChanged;
// this.FormClosing += FrmSetPlus_FormClosing;
//this.Width = 1024;
//this.Height = 738;
this.Top = 15;
this.Left = 0;
WebService.Open(BLLCommon.config.WebService);//启动条码匹配服务
LogNet.log = log4net.LogManager.GetLogger("SmartScan");
}
private void FrmSetPlus_FormClosing(object sender, FormClosingEventArgs e)
{
return;
e.Cancel = true;
ShowWindow(this.Handle, SW_HIDE);
//this.WindowState = FormWindowState.Minimized;
//this.Hide();
}
private void FrmSetPlus_SizeChanged(object sender, EventArgs e)
{
return;
if (WindowState == FormWindowState.Minimized)
{
this.Hide();
}
}
private void FrmSet_Load(object sender, EventArgs e)
{
return;
}
private void BtnMenu_Click(object sender, EventArgs e)
{
foreach (FaceButton button in menu.Keys)
{
bool rtn = button == sender;
button.HoldPress = rtn;
menu[button].GetPanel().Visible = rtn;
}
}
private void BtnOK_Click(object sender, EventArgs e)
{
foreach (FaceButton button in menu.Keys)
menu[button].Save();
string text = Language.Dialog(Model.LanguageDialogKey.SAVE_SUCCEED);
new FaceMessageBox("", text, MessageBoxButtons.OK).ShowDialog();
BLLCommon.extension.Update();
DialogResult = DialogResult.OK;
//WindowState = FormWindowState.Minimized;
ShowWindow(this.Handle, SW_HIDE);
}
public const int SW_HIDE = 0;
[DllImport("user32.dll", EntryPoint = "ShowWindow", CharSet = CharSet.Auto)]
public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
private void BtnCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
FrmSet_Load(this, EventArgs.Empty);
WindowState = FormWindowState.Minimized;
Hide();
}
private void BtnApply_Click(object sender, EventArgs e)
{
foreach (FaceButton button in menu.Keys)
menu[button].Save();
string text = Language.Dialog(Model.LanguageDialogKey.SAVE_SUCCEED);
new FaceMessageBox("", text, MessageBoxButtons.OK).ShowDialog();
BLLCommon.extension.Update();
}
private void CboLanguage_SelectedIndexChanged(object sender, EventArgs e)
{
return;
}
private void BtnHistory_Click(object sender, EventArgs e)
{
FrmRetrospect frm = new FrmRetrospect();
frm.WindowState = FormWindowState.Maximized;
frm.Show();
}
}
}