private void btnMoveDown_Click(object sender, EventArgs e) { if (currentPartEntry == ltbc.Count - 1 || ltbc.Count < 2) { return; } VPXY.Entry entry = vpxy.Entries[currentVPXYEntry]; vpxy.Entries.RemoveAt(currentVPXYEntry); if (ltbc[currentPartEntry].Tag != null) { vpxy.Entries.RemoveAt(currentVPXYEntry); } vpxy.Entries.Insert(currentVPXYEntry + 1, entry); if (ltbc[currentPartEntry].Tag != null) { vpxy.Entries.Insert(currentVPXYEntry + 2, ltbc[currentPartEntry].Tag as VPXY.Entry00); } moveDown(tlpParts, ltbc, lbCurrentPart, RenumberTLP, ref currentPartEntry); }
private void btnDel_Click(object sender, EventArgs e) { if (currentPartEntry == -1) { return; } ClearLinkedPartsTLP(true); tlpParts.Controls.Remove(lbCurrentPart); VPXY.Entry entry = vpxy.Entries[currentVPXYEntry]; vpxy.Entries.RemoveAt(currentVPXYEntry); if (ltbc[currentPartEntry].Tag != null) { vpxy.Entries.RemoveAt(currentVPXYEntry); } Control c1 = tlpParts.GetControlFromPosition(0, currentPartEntry + 1); tlpParts.Controls.Remove(c1); c1 = tlpParts.GetControlFromPosition(2, currentPartEntry + 1); tlpParts.Controls.Remove(c1); ltbc.Remove(c1 as TGIBlockCombo); for (int row = currentPartEntry + 1; row < tlpParts.RowCount - 2; row++) { c1 = tlpParts.GetControlFromPosition(0, row + 1); c1.TabIndex--; tlpParts.Controls.Add(c1, 0, row); c1 = tlpParts.GetControlFromPosition(2, row + 1); c1.TabIndex--; tlpParts.Controls.Add(c1, 2, row); } tlpParts.RowCount--; currentVPXYEntry = currentPartEntry = -1; btnAddLinked.Enabled = false; RenumberTLP(); }