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 } /// /// 保存位置。杨斌 2016-07-06 /// 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); } } }