private void AddKebabControls(List <KebabItem> kebabs) { KebabControl lastControl = null; foreach (KebabItem kebab in kebabs) { KebabControl orderControl = new KebabControl(kebab); orderControl.Left = lbTime.Right; if (lastControl == null) { orderControl.Top = lbOrderId.Top; } else { orderControl.Top = lastControl.Bottom; } orderControl.setDoubleClickListener(changeOrderColor); lastControl = orderControl; this.Controls.Add(orderControl); } lbOrderId.Height = lastControl.Bottom - lbOrderId.Top; lbTime.Height = lbOrderId.Height; lbState.Height = lbTime.Height + 10; this.Height = lbState.Height; }
private void AddKebabControls(List <KebabItem> kebabs) { KebabControl lastControl = null; foreach (KebabItem kebab in kebabs) { KebabControl orderControl = new KebabControl(kebab); orderControl.setWidth(Width - lbTime.Right); orderControl.Left = lbTime.Right; if (lastControl == null) { orderControl.Top = lbDate.Top; } else { orderControl.Top = lastControl.Bottom; } lastControl = orderControl; this.Controls.Add(orderControl); } lbDate.Height = lastControl.Bottom - lbDate.Top; lbTime.Height = lbDate.Height; this.Height = lbDate.Height; }