public void CreateControl(List <ImageButtonItem> list) { if (list == null || list.Count <= 0) { return; } int nWidth = 100; int nHeight = 30; int _RowSpace = 5; int nUnitPage = _RowSpace + nWidth; int nCount = 0; foreach (ImageButtonItem ibi in list) { Image img = ibi._Img; string szDisplayText = ibi._DisplayText; UC_ImageButton ibv = new UC_ImageButton(img, szDisplayText); ibv.Location = new Point((nCount + 1) * nUnitPage - nWidth, 2); ibv.Width = nWidth; ibv.Height = nHeight; ibv.Tag = ibi._objFlag; ibv.Click += new EventHandler(On_ImageButtonItemClick); this.Controls.Add(ibv); nCount++; } }
private void uib_Click(object sender, EventArgs e) { UC_ImageButton uib = (UC_ImageButton)sender; ClearAlluibControlSelected(); uib.Selected = true; //!uib.Selected; this._SeatTypeFlag = uib.Tag.ToString(); if (seatChartDisp1._seatCharItemsSelect._listControlSelect.Count > 0) { bool bHaveGroupItem = false; foreach (Control ctl in seatChartDisp1._seatCharItemsSelect._listControlSelect) { if (ctl.GetType() == typeof(SeatMaDll.BHSeatControl)) { SeatMaDll.BHSeatControl seat = (SeatMaDll.BHSeatControl)ctl; SeatMaDll.Seat st = (SeatMaDll.Seat)seat.Tag; if (st._brotherList.Count <= 0) { st._seatFlag = this._SeatTypeFlag; seat.SeatType = SeatMaDll.EditSeatItem.GetControl_ByFlag(this._SeatTypeFlag); } else { bHaveGroupItem = true; } } } if (bHaveGroupItem) { MessageBox.Show("选项中有双座或包厢座,请点击该包厢进行设定!", "系统提示"); } } }
private void ClearAlluibControlSelected() { foreach (Control ctl in panel_uidContainer.Controls) { if (ctl.GetType() == typeof(UC_ImageButton)) { UC_ImageButton uib = (UC_ImageButton)ctl; uib.Selected = false; } } }
public void ClearAlluibControlSelected() { foreach (Control ctl in this.Controls) { if (ctl.GetType() == typeof(UC_ImageButton)) { UC_ImageButton uib = (UC_ImageButton)ctl; uib.Selected = false; } } }
private void InitAlluibControlSelected() { foreach (Control ctl in panel_uidContainer.Controls) { if (ctl.GetType() == typeof(UC_ImageButton)) { UC_ImageButton uib = (UC_ImageButton)ctl; if (uib.Tag == null) { continue; } if (uib.Tag.ToString() == _seatTypeFlag) { uib.Selected = true; return; } } } }
private void InitAlluibControlSelected() { foreach (Control ctl in uC_ImageButtonPanel1.Controls) { if (ctl.GetType() == typeof(UC_ImageButton)) { UC_ImageButton uib = (UC_ImageButton)ctl; if (uib.Tag == null) { continue; } SimBlock sb = (SimBlock)uib.Tag; if (sb._BlockId == _SimBlockObj._BlockId) { uib.Selected = true; return; } } } }