public void viewProducts(OrderedDoublyLinkedList odl) { Node current = odl.getFirst(); int xCount = 0; int totalCount = 0; while (current != null) { productView pv = new productView(current.getItem(), f1); if (xCount < 6) { pv.Location = new Point(x, y); panel1.Controls.Add(pv); x += 205; current = current.getNext(); xCount++; totalCount++; } else { if (totalCount % 6 == 0) { y += 210; x = 10; pv.Location = new Point(10, y); panel1.Controls.Add(pv); current = current.getNext(); xCount = 0; } } } }
public void viewProducts(OrderedDoublyLinkedList odl) { Node current = odl.getFirst(); adminSeeProduct asp; while (current != null) { asp = new adminSeeProduct(current.getItem(), this); panel1.Controls.Add(asp); asp.Location = new Point(0, y); y += 151; current = current.getNext(); } }