public ProjectionControl(frm_ChooseProjection Parent, string Code, string Vn_Name, string En_Name, int STT,bool IsUsed4Emerency) { InitializeComponent(); this.IsUsed4Emerency = IsUsed4Emerency; if (IsUsed4Emerency) ProjectionObject.Image = DROCLibs.Properties.Resources.HELP; this.STT = STT; this.Parent = Parent; this.Code = Code; this.Vn_Name = Vn_Name; this.En_Name = En_Name; ProjectionObject.Text = Vn_Name; ProjectionObject.Click += new EventHandler(ProjectionObject_Click); }
private void cmdChooseProjection_Click(object sender, EventArgs e) { try { frm_ChooseProjection _ChooseProjection = new frm_ChooseProjection(); if (_ChooseProjection.ShowDialog() == DialogResult.OK) { progressBar1.Visible = true; progressBar1.Minimum = 0; progressBar1.Maximum = _ChooseProjection.SelectedObjectCount; progressBar1.Value = 0; foreach (Control ctr in _ChooseProjection._pnlProjection.Controls) { ProjectionControl _Projection = ctr as ProjectionControl; if (_Projection.isPressed) { progressBar1.Value += 1; if (!isExistProjection(_Projection.Code)) { ProjectionControl _NewProjection = _Projection.Copy(); AddRow(_Anatomy.Code, _NewProjection.Code, _Anatomy.Vn_Name, _Anatomy.En_Name, _NewProjection.Vn_Name, _NewProjection.En_Name, CurrDevice_ID, 0); _NewProjection._OnClick += new ProjectionControl.OnClick(_NewProjection__OnClick); pnlProjectionList.Controls.Add(_NewProjection); } } } } } catch { } finally { progressBar1.Visible = false; } }