void FillPartsTLP() { tlpParts.SuspendLayout(); ClearPartsTLP(); int tabindex = 1; for (int i = 0; i < vpxy.Entries.Count; i++) { if (vpxy.Entries[i] as VPXY.Entry00 != null) { ltbc[ltbc.Count - 1].Tag = vpxy.Entries[i] as VPXY.Entry00; } else if (vpxy.Entries[i] as VPXY.Entry01 != null) { VPXY.Entry01 e01 = vpxy.Entries[i] as VPXY.Entry01; AddTableRowTBC(tlpParts, i, (int)e01.TGIIndex, ref tabindex); } } tlpParts.ResumeLayout(); }
void tbc_SelectedIndexChanged(object sender, EventArgs e) { TGIBlockCombo tbc = sender as TGIBlockCombo; if (ltbc.Contains(tbc)) { int i = int.Parse(((Label)tlpParts.GetControlFromPosition(0, tlpParts.GetCellPosition(tbc).Row)).Text, System.Globalization.NumberStyles.HexNumber); VPXY.Entry01 e01 = vpxy.Entries[i] as VPXY.Entry01; e01.TGIIndex = (tbc.SelectedIndex >= 0) ? tbc.SelectedIndex : 0; } else { if (currentPartEntry == -1) { return; } VPXY.Entry00 e00 = ltbc[currentPartEntry].Tag as VPXY.Entry00; int i = lLPtbc.IndexOf(tbc); e00.TGIIndexes[i] = (tbc.SelectedIndex >= 0) ? tbc.SelectedIndex : 0; } }