Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6d1716ad
由
几米阳光
编写于
2018-07-20 10:14:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加界面隐藏功能,开机自动隐藏界面
1 个父辈
3e7085ac
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
118 行增加
和
20 行删除
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/FrmStoreBox.resx
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
6d1716a
...
...
@@ -156,12 +156,18 @@
this
.
btnOpenWCF
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnCloseWCF
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
chbAuto
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
contextMenuStrip1
=
new
System
.
Windows
.
Forms
.
ContextMenuStrip
(
this
.
components
);
this
.
显示
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripMenuItem1
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
notifyIcon1
=
new
System
.
Windows
.
Forms
.
NotifyIcon
(
this
.
components
);
this
.
退出
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
groupBox5
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
this
.
menuStrip1
.
SuspendLayout
();
this
.
groupBox3
.
SuspendLayout
();
this
.
groupBox6
.
SuspendLayout
();
this
.
contextMenuStrip1
.
SuspendLayout
();
this
.
SuspendLayout
();
//
// timer1
...
...
@@ -1593,7 +1599,8 @@
this
.
启动
ToolStripMenuItem
,
this
.
停止
ToolStripMenuItem
,
this
.
复位
ToolStripMenuItem
,
this
.
回待机点
ToolStripMenuItem
});
this
.
回待机点
ToolStripMenuItem
,
this
.
退出
ToolStripMenuItem
});
this
.
料仓操作
ToolStripMenuItem
.
Name
=
"料仓操作ToolStripMenuItem"
;
this
.
料仓操作
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
68
,
21
);
this
.
料仓操作
ToolStripMenuItem
.
Text
=
"料仓操作"
;
...
...
@@ -1805,6 +1812,42 @@
this
.
chbAuto
.
UseVisualStyleBackColor
=
true
;
this
.
chbAuto
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
chbAuto_CheckedChanged
);
//
// contextMenuStrip1
//
this
.
contextMenuStrip1
.
Items
.
AddRange
(
new
System
.
Windows
.
Forms
.
ToolStripItem
[]
{
this
.
显示
ToolStripMenuItem
,
this
.
toolStripMenuItem1
});
this
.
contextMenuStrip1
.
Name
=
"contextMenuStrip1"
;
this
.
contextMenuStrip1
.
Size
=
new
System
.
Drawing
.
Size
(
116
,
48
);
//
// 显示ToolStripMenuItem
//
this
.
显示
ToolStripMenuItem
.
Name
=
"显示ToolStripMenuItem"
;
this
.
显示
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
115
,
22
);
this
.
显示
ToolStripMenuItem
.
Text
=
"显示(&S)"
;
this
.
显示
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
显示
ToolStripMenuItem_Click
);
//
// toolStripMenuItem1
//
this
.
toolStripMenuItem1
.
Name
=
"toolStripMenuItem1"
;
this
.
toolStripMenuItem1
.
Size
=
new
System
.
Drawing
.
Size
(
115
,
22
);
this
.
toolStripMenuItem1
.
Text
=
"退出(&E)"
;
this
.
toolStripMenuItem1
.
Click
+=
new
System
.
EventHandler
(
this
.
toolStripMenuItem1_Click
);
//
// notifyIcon1
//
this
.
notifyIcon1
.
ContextMenuStrip
=
this
.
contextMenuStrip1
;
this
.
notifyIcon1
.
Icon
=
((
System
.
Drawing
.
Icon
)(
resources
.
GetObject
(
"notifyIcon1.Icon"
)));
this
.
notifyIcon1
.
Text
=
"料仓客户端"
;
this
.
notifyIcon1
.
Visible
=
true
;
//
// 退出ToolStripMenuItem
//
this
.
退出
ToolStripMenuItem
.
Name
=
"退出ToolStripMenuItem"
;
this
.
退出
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
180
,
22
);
this
.
退出
ToolStripMenuItem
.
Text
=
"退出系统"
;
this
.
退出
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
退出
ToolStripMenuItem_Click
);
//
// FrmStoreBox
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
...
...
@@ -1824,6 +1867,7 @@
this
.
Text
=
"AC_SA_料仓"
;
this
.
WindowState
=
System
.
Windows
.
Forms
.
FormWindowState
.
Maximized
;
this
.
FormClosing
+=
new
System
.
Windows
.
Forms
.
FormClosingEventHandler
(
this
.
FrmTest_FormClosing
);
this
.
FormClosed
+=
new
System
.
Windows
.
Forms
.
FormClosedEventHandler
(
this
.
FrmStoreBox_FormClosed
);
this
.
Load
+=
new
System
.
EventHandler
(
this
.
FrmTest_Load
);
this
.
Shown
+=
new
System
.
EventHandler
(
this
.
FrmStoreBox_Shown
);
this
.
groupBox5
.
ResumeLayout
(
false
);
...
...
@@ -1837,6 +1881,7 @@
this
.
groupBox3
.
ResumeLayout
(
false
);
this
.
groupBox3
.
PerformLayout
();
this
.
groupBox6
.
ResumeLayout
(
false
);
this
.
contextMenuStrip1
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
this
.
PerformLayout
();
...
...
@@ -1976,6 +2021,11 @@
private
System
.
Windows
.
Forms
.
CheckBox
chbAutoRead
;
private
System
.
Windows
.
Forms
.
Label
lblTemp
;
private
System
.
Windows
.
Forms
.
CheckBox
chbAuto
;
private
System
.
Windows
.
Forms
.
ContextMenuStrip
contextMenuStrip1
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
显示
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
toolStripMenuItem1
;
private
System
.
Windows
.
Forms
.
NotifyIcon
notifyIcon1
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
退出
ToolStripMenuItem
;
}
}
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
6d1716a
...
...
@@ -145,6 +145,7 @@ namespace OnlineStore.ACSingleStore
this
.
ShowInTaskbar
=
true
;
this
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
App_Title
);
LoadOk
=
true
;
HideForm
();
}
private
DateTime
preReadModblsTime
=
DateTime
.
Now
;
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
...
...
@@ -359,26 +360,10 @@ namespace OnlineStore.ACSingleStore
private
void
FrmTest_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
try
if
(
e
.
CloseReason
==
CloseReason
.
UserClosing
)
//当用户点击窗体右上角X按钮或(Alt + F4)时 发生
{
if
(
this
.
timer1
.
Enabled
)
{
this
.
timer1
.
Enabled
=
false
;
}
if
(
this
.
停止
ToolStripMenuItem
.
Enabled
)
{
stop_button_Click
(
null
,
null
);
}
KNDManager
.
CloseAllDO
();
StoreOpenStatus
(
false
);
KNDManager
.
CloseAllConnection
();
WCFControl
.
CloseWCF
();
}
catch
(
Exception
ex
)
{
MessageBox
.
Show
(
ex
.
StackTrace
,
"Exception(异常)"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
LogUtil
.
error
(
LOGGER
,
ex
.
StackTrace
);
e
.
Cancel
=
true
;
HideForm
();
}
}
private
void
btnOutStore_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -1116,5 +1101,68 @@ namespace OnlineStore.ACSingleStore
ManagerUtil
.
AutoRun
(
Application
.
ExecutablePath
,
false
);
}
}
private
void
显示
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
this
.
Visible
=
true
;
this
.
WindowState
=
FormWindowState
.
Maximized
;
this
.
notifyIcon1
.
Visible
=
false
;
this
.
ShowInTaskbar
=
true
;
}
private
void
ExitApp
()
{
try
{
if
(
this
.
timer1
.
Enabled
)
{
this
.
timer1
.
Enabled
=
false
;
}
if
(
this
.
停止
ToolStripMenuItem
.
Enabled
)
{
stop_button_Click
(
null
,
null
);
}
KNDManager
.
CloseAllDO
();
StoreOpenStatus
(
false
);
KNDManager
.
CloseAllConnection
();
WCFControl
.
CloseWCF
();
System
.
Environment
.
Exit
(
System
.
Environment
.
ExitCode
);
}
catch
(
Exception
ex
)
{
MessageBox
.
Show
(
ex
.
StackTrace
,
"Exception(异常)"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
LogUtil
.
error
(
LOGGER
,
ex
.
StackTrace
);
}
}
private
void
toolStripMenuItem1_Click
(
object
sender
,
EventArgs
e
)
{
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出?"
,
"提示"
,
MessageBoxButtons
.
YesNo
);
if
(
result
.
Equals
(
DialogResult
.
Yes
))
{
ExitApp
();
}
}
/// <summary>
/// 隐藏窗口
/// </summary>
private
void
HideForm
()
{
this
.
ShowInTaskbar
=
false
;
this
.
notifyIcon1
.
Visible
=
true
;
this
.
Hide
();
}
private
void
FrmStoreBox_FormClosed
(
object
sender
,
FormClosedEventArgs
e
)
{
ExitApp
();
}
private
void
退出
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出?"
,
"提示"
,
MessageBoxButtons
.
YesNo
);
if
(
result
.
Equals
(
DialogResult
.
Yes
))
{
ExitApp
();
}
}
}
}
source/ACSingleStore/FrmStoreBox.resx
查看文件 @
6d1716a
此文件的差异被折叠,
点击展开。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论