void menu_Button_Open_Click(object sender, EventArgs e) { UC_Menu menu = (UC_Menu)sender; FrmMeterBusiness frm = new FrmMeterBusiness(); frm.MenuID = menu.ID; frm.sTitle = menu.SLabelText; frm.PictureName = menu.SProcessName; GoTo(this, frm, true); }
public void uC_Menu1_UC_Click(object sender, EventArgs e) { panel_main.Controls.RemoveAt(0); panel_main.Controls.Add(monit); um.BackgroundImage = Properties.Resources.a; um.FontColor = Color.FromArgb(204, 204, 204); uC_Menu1.BackgroundImage = Properties.Resources.a1; uC_Menu1.FontColor = Color.White; um = uC_Menu1; monit.Show(); }
void menu_Button_Open_Click(object sender, EventArgs e) { UC_Menu menu = (UC_Menu)sender; string AssemblyName = menu.AssemblyName; string btnname = menu.SProcessName; CreateForm(AssemblyName + "." + btnname, AssemblyName); //FrmRecords frm = new FrmRecords(); }
void menu_Button_Open_Click(object sender, EventArgs e) { UC_Menu menu = (UC_Menu)sender; try { string path = menu.AssemblyName; //项目的Assembly选项名称 string name = menu.AssemblyName + "." + menu.SProcessName; //类的名字 Form Frm = (Form)Assembly.Load(path).CreateInstance(name); Frm.ShowDialog(); } catch (Exception ex) { } }
public void uC_Menu3_UC_Click_1(object sender, EventArgs e) { cg = new Forms.Changgui(); cg.TopLevel = false; cg.Dock = DockStyle.Fill; panel_main.Controls.RemoveAt(0); panel_main.Controls.Add(cg); um.BackgroundImage = Properties.Resources.a; um.FontColor = Color.FromArgb(204, 204, 204); uC_Menu3.BackgroundImage = Properties.Resources.a1; uC_Menu3.FontColor = Color.White; um = uC_Menu3; cg.Tag = sender; cg.Show(); }
public void uC_Menu12_UC_Click(object sender, EventArgs e) { tufa = new Forms.Tufa(); tufa.TopLevel = false; tufa.Dock = DockStyle.Fill; panel_main.Controls.RemoveAt(0); panel_main.Controls.Add(tufa); um.BackgroundImage = Properties.Resources.a; um.FontColor = Color.FromArgb(204, 204, 204); uC_Menu12.BackgroundImage = Properties.Resources.a1; uC_Menu12.FontColor = Color.White; um = uC_Menu12; tufa.Tag = sender; tufa.Show(); }
public void uC_Menu11_UC_Click(object sender, EventArgs e) { zd = new Forms.Zhongdian(); zd.TopLevel = false; zd.Dock = DockStyle.Fill; panel_main.Controls.RemoveAt(0); panel_main.Controls.Add(zd); um.BackgroundImage = Properties.Resources.a; um.FontColor = Color.FromArgb(204, 204, 204); uC_Menu11.BackgroundImage = Properties.Resources.a1; uC_Menu11.FontColor = Color.White; um = uC_Menu11; zd.Tag = sender; zd.Show(); }
public void uC_Menu10_UC_Click(object sender, EventArgs e) { mingan = new Forms.Mingan(); mingan.TopLevel = false; mingan.Dock = DockStyle.Fill; panel_main.Controls.RemoveAt(0); panel_main.Controls.Add(mingan); um.BackgroundImage = Properties.Resources.a; um.FontColor = Color.FromArgb(204, 204, 204); uC_Menu10.BackgroundImage = Properties.Resources.a1; uC_Menu10.FontColor = Color.White; um = uC_Menu10; mingan.Tag = sender; mingan.Show(); }
private void uC_Menu9_UC_Click(object sender, EventArgs e) { panel_main.Controls.RemoveAt(0); panel_main.Controls.Add(home); um.BackgroundImage = Properties.Resources.a; um.FontColor = Color.FromArgb(204, 204, 204); uC_Menu9.BackgroundImage = Properties.Resources.a1; uC_Menu9.FontColor = Color.White; um = uC_Menu9; if (Comm.isChangedEvents) { home.readData(); Comm.isChangedEvents = false; } home.Show(); }
private void GetMenus() { DataTable dt = new SqlServerHelper().GetDataTable("Meter_WaterBusiness", "", "Sort"); if (DataTableHelper.IsExistRows(dt)) { foreach (DataRow dr in dt.Rows) { UC_Menu menu = new UC_Menu(); menu.ID = int.Parse(dr["MenuID"].ToString()); menu.SHeadImage = dr["ICO"].ToString(); menu.SLabelText = dr["MenuName"].ToString(); menu.SProcessName = dr["FrmName"].ToString(); menu.Button_Open_Click += new EventHandler(menu_Button_Open_Click); FP.Controls.Add(menu); } } }
private void GetMeter_WaterBusiness_Sub() { DataTable dt = sysidal.GetWaterBusinessSub(MenuID); if (DataTableHelper.IsExistRows(dt)) { foreach (DataRow dr in dt.Rows) { if (sysidal.IsAuthority(dr["SubID"].ToString())) { UC_Menu menu = new UC_Menu(); menu.ID = int.Parse(dr["SubID"].ToString()); menu.SHeadImage = dr["ICO"].ToString(); menu.SLabelText = dr["MenuName"].ToString(); menu.SProcessName = dr["FrmName"].ToString(); menu.Button_Open_Click += new EventHandler(menu_Button_Open_Click); menu.AssemblyName = dr["AssemblyName"].ToString(); FP.Controls.Add(menu); } } } }
private void button2_Click(object sender, EventArgs e) { UC_Menu uC_Menu = new UC_Menu(); addControll(uC_Menu); }
void menu_Button_Open_Click(object sender, EventArgs e) { UC_Menu UM = (UC_Menu)sender; CreateForm.ShowPannel(UM.SProcessName, UM.AssemblyName, this.PL, null); }
private void MainForm_Load(object sender, EventArgs e) { //UserInfo ui = (UserInfo)GlobalPars.GloPars["UserInfo"]; //lb_username.Text = ui.UName; //读取超级狗里的数据文件,确定用户ID。 //dogId = Comm.GetDogFile(1); //if (string.IsNullOrEmpty(dogId)) //{ // if (MessageBox.Show("读取加密狗信息失败,请检查加密狗!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error) == System.Windows.Forms.DialogResult.OK) // { // System.Environment.Exit(0); // } //} //else //{ // GlobalPars.GloPars.Add("userID", dogId); //} //获取软件版本(1、基础版。2、高级版。3、专业版) string softVer = "3"; if (string.IsNullOrWhiteSpace(softVer) || (!softVer.Equals("1")) && (!softVer.Equals("2")) && (!softVer.Equals("3"))) { if (MessageBox.Show("读取软件信息错误,请联系软件发布商!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error) == System.Windows.Forms.DialogResult.OK) { System.Environment.Exit(0); } } GlobalPars.GloPars.Add("SoftVer", softVer); GenCacheData(); string SoftVer = !GlobalPars.GloPars.ContainsKey("SoftVer") ? "2" : GlobalPars.GloPars["SoftVer"].ToString(); if (!SoftVer.Equals("1")) { updateT.AutoReset = true; updateT.Elapsed += new System.Timers.ElapsedEventHandler(updateT_Elapsed); updateT.Enabled = true; } tongjiT.AutoReset = true; tongjiT.Elapsed += new System.Timers.ElapsedEventHandler(tongjiT_Elapsed); tongjiT.Enabled = true; delExpiredDbData.AutoReset = true; delExpiredDbData.Elapsed += new System.Timers.ElapsedEventHandler(delExpiredDbData_Elapsed); delExpiredDbData.Enabled = true; //2016.4.19 服务网站已经不可用了,暂停检查 //检测试用,且第一次打开程序,要向服务端提交客户端在线数 //Thread trailT = new Thread(new ThreadStart(CheckTrail)); //trailT.IsBackground = true; //trailT.Start(); //报警 Alert alert = new Alert(1000 * 60); alert.Start(); //生成所有Forms AddAllFormsInControl(); //默认显示监控界面。 um = uC_Menu1; uC_Menu9_UC_Click(null, null); //使窗体可以使用透明色。 SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true); if (SoftVer.Equals("1")) { uC_Menu10.Enabled = false; uC_Menu11.Enabled = false; uC_Menu12.Enabled = false; } }