FrmVoteBarSmall.cs
5.19 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
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 GeneralLib;
using System.IO;
namespace SunVoteARSPPT
{
public partial class FrmVoteBarSmall : Form
{
public FrmVoteBarSmall()
{
InitializeComponent();
}
private bool voteState = false;
public bool IsVoting
{
get
{
return voteState;
}
set
{
voteState = value;
try
{
//杨斌 2016-07-06
string path = "";
if (value)
{
path = GlobalInfo.sysConfig.FrmVoteBarSmall_PngVoting;
if (!File.Exists(path))
path = GlobalInfo.APP_DIR + @"\Resources\Image\VoteBar\Voting.png";
this.BackgroundImage = Image.FromFile(path);
lblVoting.Visible = true;
lblStop.Visible = false;
}
else
{
path = GlobalInfo.sysConfig.FrmVoteBarSmall_PngStop;
if (!File.Exists(path))
path = GlobalInfo.APP_DIR + @"\Resources\Image\VoteBar\Stop.png";
this.BackgroundImage = Image.FromFile(path);
lblVoting.Visible = false;
lblStop.Visible = true;
}
if (GlobalInfo.OEMLogo == OEMLogos.oemVoteExplorer)//杨斌 2018-03-06
{
lblVoting.Visible = lblStop.Visible = false;
}
}
catch (Exception ex)
{
SystemLog.WriterLog(ex);
}
}
}
private void FrmVoteBarSmall_Load(object sender, EventArgs e)
{
//杨斌 2016-08-29
lblVoting.Text = "";
lblStop.Text = "";
GlobalInfo.SysLanguage.SetLanguage(this.Name, this);
lblVoting.Font = new Font(lblVoting.Font.Name, 12, FontStyle.Bold);
lblStop.Font = new Font(lblStop.Font.Name, 12, FontStyle.Bold);
try
{
lblVoting.Dock = DockStyle.Fill;
lblStop.Dock = DockStyle.Fill;
//IsVoting = false;//屏蔽此行,已在外部设置。播放ppt自动启动反馈时状态为true。杨斌 2015-05-22
this.Width = this.BackgroundImage.Width;
this.Height = this.BackgroundImage.Height;
//杨斌 2014-09-16
Screen scrShow = ControlOper.GetSecondScreen();
//杨斌 2016-07-06
if ((GlobalInfo.sysConfig.FrmVoteBarSmall_X == 0) && (GlobalInfo.sysConfig.FrmVoteBarSmall_Y == 0))
{
this.Left = scrShow.Bounds.Right - this.Width - 20;
this.Top = scrShow.Bounds.Bottom - this.Height - 20;
}
else
{
this.Left = GlobalInfo.sysConfig.FrmVoteBarSmall_X;
this.Top = GlobalInfo.sysConfig.FrmVoteBarSmall_Y;
ControlOper.CheckMoveRange(this);//杨斌 2014-09-12
SavePos();//杨斌 2016-07-06
}
}
catch (Exception ex)
{
SystemLog.WriterLog(ex);
}
}
private void FrmVoteBarSmall_MouseDown(object sender, MouseEventArgs e)
{
ControlOper.MoveControl(this.Handle);//杨斌 2014-09-12
}
private void lblStop_MouseDown(object sender, MouseEventArgs e)
{
ControlOper.MoveControl(this.Handle);//杨斌 2014-09-12
}
private void lblVoting_MouseDown(object sender, MouseEventArgs e)
{
ControlOper.MoveControl(this.Handle);//杨斌 2014-09-12
}
private void FrmVoteBarSmall_MouseLeave(object sender, EventArgs e)
{
ControlOper.CheckMoveRange(this);//杨斌 2014-09-12
SavePos();//杨斌 2016-07-06
}
private void lblVoting_MouseLeave(object sender, EventArgs e)
{
ControlOper.CheckMoveRange(this);//杨斌 2014-09-12
SavePos();//杨斌 2016-07-06
}
private void lblStop_MouseLeave(object sender, EventArgs e)
{
ControlOper.CheckMoveRange(this);//杨斌 2014-09-12
SavePos();//杨斌 2016-07-06
}
/// <summary>
/// 保存位置。杨斌 2016-07-06
/// </summary>
private void SavePos()
{
GlobalInfo.sysConfig.FrmVoteBarSmall_X = this.Left;
GlobalInfo.sysConfig.FrmVoteBarSmall_Y = this.Top;
GlobalInfo.sysConfig.WriteSysConfig("System", "FrmVoteBarSmall_X", GlobalInfo.sysConfig.FrmVoteBarSmall_X);
GlobalInfo.sysConfig.WriteSysConfig("System", "FrmVoteBarSmall_Y", GlobalInfo.sysConfig.FrmVoteBarSmall_Y);
}
}
}