Exemplo n.º 1
0
 public void ItemDeleteClicked(SendDataItem item, EventArgs e)
 {
     if (Items.Count > 1)
     {
         Items.Remove(item);
         dataItemsPanel.Controls.Remove(item);
     }
 }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
 public void ItemDuplicateClicked(SendDataItem item, EventArgs e)
 {
 }
Exemplo n.º 4
0
 public void ItemSendDataClicked(SendDataItem item, EventArgs e)
 {
 }