public void Add(CheckBoxItem chk) { chk.Click += new EventHandler(this.CheckedChanged); this.pnlChk.Controls.Add(chk); this.pnlChk.Controls.SetChildIndex(chk, this.Count - 1); chk.Dock = DockStyle.Bottom; }
public void Add(CheckBoxItem chk) { chk.Click += new EventHandler(this.CheckedChanged); this.pnlChk.Controls.Add(chk); this.pnlChk.Controls.SetChildIndex(chk, this.Count - 1); chk.Dock = DockStyle.Bottom; }
public void CheckedChanged(object sender, EventArgs e) { if (this.CheckItem != null) { CheckBoxItem chk = (CheckBoxItem) sender; int index = this.IndexOf(chk); if (index >= 0) { CheckState @unchecked = CheckState.Unchecked; if (chk.CheckState == CheckState.Checked) { @unchecked = CheckState.Unchecked; } else { @unchecked = CheckState.Checked; } ItemCheckEventArgs args = new ItemCheckEventArgs(index, chk.CheckState, @unchecked); this.CheckItem(this, args); } } }
private void InitData() { DataTable table = RemotingClient.Car_GetRegionInfo(MainForm.myCarList.SelectedCarId, 0); if (table != null) { for (int i = 0; i < table.Rows.Count; i++) { string str2 = table.Rows[i]["regionName"].ToString(); string str3 = table.Rows[i]["RegionId"].ToString(); string sRegionDot = table.Rows[i]["regionDot"].ToString(); table.Rows[i]["regionType"].ToString(); if (Check.isRectangle(sRegionDot)) { CheckBoxItem chk = new CheckBoxItem { Name = str3, Text = str2, Tag = sRegionDot }; this.chkListRegion.Add(chk); } } } }
private void setGroupText() { this.chkLstArea.Clear(); DataTable table = RemotingClient.Car_GetRegionInfo(base.sCarId, this.iRegionFeature); if (table != null) { DataRow[] rowArray = table.Select("NewRegionId is not null"); int length = rowArray.Length; if ((table != null) && (length > 0)) { foreach (DataRow row in rowArray) { CheckBoxItem chk = new CheckBoxItem { Text = row["RegionName"].ToString(), Name = row["NewRegionId"].ToString(), Tag = this.GetRegionType(row["RegionDot"].ToString()) }; this.chkLstArea.Add(chk); } } } this.cbRegionType.SelectedIndex = 0; }
public int IndexOf(CheckBoxItem chk) { return this.pnlChk.Controls.IndexOf(chk); }
private void setGroupText() { this.chkLstArea.Clear(); if (base.OrderCode == CmdParam.OrderCode.取消报警区域值) { DataTable table = RemotingClient.Car_GetRegionInfo(base.sCarId, this.iRegionFeature); if ((table != null) && (table.Rows.Count > 0)) { foreach (DataRow row in table.Rows) { if (!string.IsNullOrEmpty(row["NewRegionId"].ToString()) && !"0".Equals(row["NewRegionId"].ToString())) { CheckBoxItem chk = new CheckBoxItem { Text = row["RegionName"].ToString(), Name = row["NewRegionId"].ToString() }; this.chkLstArea.Add(chk); } } } this.chkLstArea.Enabled = this.cbxExpandRegion.Checked; } }
public int IndexOf(CheckBoxItem chk) { return this.pnlChk.Controls.IndexOf(chk); }
private void setGroupText() { this.chkLstArea.Clear(); DataTable pathAlarmChecked = RemotingClient.GetPathAlarmChecked(base.sCarId); if ((pathAlarmChecked != null) && (pathAlarmChecked.Rows.Count > 0)) { DataRow[] rowArray = pathAlarmChecked.Select(); int length = rowArray.Length; if ((pathAlarmChecked != null) && (length > 0)) { foreach (DataRow row in rowArray) { CheckBoxItem chk = new CheckBoxItem { Text = row["pathname"].ToString(), Name = row["newpathid"].ToString() }; this.chkLstArea.Add(chk); } } } }