public void ItemDeleteClicked(SendDataItem item, EventArgs e) { if (Items.Count > 1) { Items.Remove(item); dataItemsPanel.Controls.Remove(item); } }
private void btnNewItemClicked(object sender, EventArgs e) { var item = new SendDataItem() { AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink, BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle, Location = new System.Drawing.Point(2, 28), Margin = new System.Windows.Forms.Padding(2), Name = $"sendDataItem{Items.Count + 1}", Size = sendDataItem1.Size, TabIndex = 4 + Items.Count, }; Items.Add(item); dataItemsPanel.SuspendLayout(); dataItemsPanel.Controls.Add(item); dataItemsPanel.ResumeLayout(); if (dataItemsPanel.HorizontalScroll.Visible) { dataItemsPanel.HorizontalScroll.Visible = false; var pa = dataItemsPanel.Padding; if (pa.Right == SystemInformation.VerticalScrollBarWidth + 4) { pa.Right = SystemInformation.VerticalScrollBarWidth + 4; dataItemsPanel.Padding = pa; } dataItemsPanel.Width -= SystemInformation.VerticalScrollBarWidth; } else { var pa = dataItemsPanel.Padding; if (pa.Right == 0 + 4) { pa.Right = 0 + 4; dataItemsPanel.Padding = pa; } dataItemsPanel.Width -= SystemInformation.VerticalScrollBarWidth; } }
public void ItemDuplicateClicked(SendDataItem item, EventArgs e) { }
public void ItemSendDataClicked(SendDataItem item, EventArgs e) { }