//FUNCION PARA CREAR LOS BOTONES DE CATEGORIAS public void crearBotones(Palatium.Clases.ClaseItems items) { pnlItemsCategorias.Controls.Clear(); pnlItemsCategorias.Visible = true; int h = 0; if (items.llenarDatos() == true) { for (int i = 0; i < 15; i++) { for (int j = 0; j < 5; j++) { boton1[i, j] = new Button(); boton1[i, j].Click += boton_clic1; boton1[i, j].Width = 120; boton1[i, j].Height = 70; boton1[i, j].Top = i * 70; boton1[i, j].Left = j * 120; boton1[i, j].Font = new Font("Arial", 10, FontStyle.Bold); if (h == items.cuenta) { break; } boton1[i, j].Tag = h; boton1[i, j].AccessibleName = items.items[h].iCodigo; //boton1[i, j].BackColor = Color.GhostWhite; boton1[i, j].BackColor = Color.FromArgb(255, 255, 128); //255; 255; 128 boton1[i, j].Text = items.items[h].iDescripcion; this.Controls.Add(boton1[i, j]); pnlItemsCategorias.Controls.Add(boton1[i, j]); h++; } } } }
//FUNCION PARA CREAR LOS BOTONES PARA MOSTRAR LOS ITEMS DE SUBCATEGORIAS public void crearBotonesItemsSubcategorias(Palatium.Clases.ClaseItems items) { int h = 0; if (items.llenarDatos() == true) { for (int i = 0; i < 10; i++) { for (int j = 0; j < 3; j++) { if (h == items.cuenta) { break; } boton5[i, j] = new Button(); boton5[i, j].Click += boton_clic1; boton5[i, j].Width = 120; boton5[i, j].Height = 63; boton5[i, j].Top = i * 63; boton5[i, j].Left = j * 120; boton5[i, j].Visible = true; boton5[i, j].Tag = h; //boton5[i, j].BackColor = Color.GhostWhite; boton5[i, j].BackColor = Color.FromArgb(255, 255, 128); boton5[i, j].Text = items.items[h].iDescripcion; boton5[i, j].AccessibleName = items.items[h].iCodigo; this.Controls.Add(boton5[i, j]); pnlItemsSubcategoria.Controls.Add(boton5[i, j]); h++; } } } }