You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

49 lines
1.1 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ButcherFactory.BO;
namespace ButcherFactory.Controls
{
public partial class CodePanel : UserControl
{
public CodePanel()
{
InitializeComponent();
}
public void Add(Control v, bool top = false)
{
flowLayoutPanel1.Controls.Add(v);
if (top)
{
flowLayoutPanel1.Controls.SetChildIndex(v, 0);
}
}
internal void RemoveBar(string barCode)
{
ColorButton target = null;
foreach (ColorButton item in flowLayoutPanel1.Controls)
{
var tag = (SegmentProduction)item.Tag;
if (tag.BarCode == barCode)
{
target = item;
break;
}
}
if (target != null)
{
flowLayoutPanel1.Controls.Remove(target);
}
}
}
}