Пример #1
0
        public static ToolStripMenuItem crearMenuItem(VentasModel.Entities.Menu menu)
        {
            ToolStripMenuItem toolStripMenuItem = new ToolStripMenuItem();

            try
            {
                toolStripMenuItem.Name = menu.Nombre;
                toolStripMenuItem.Text = menu.Titulo;
                toolStripMenuItem.AccessibleDescription = menu.Pagina.Nombre;
                toolStripMenuItem.AccessibleName        = menu.Pagina.Id.ToString();
            }
            catch (Exception e)
            {
            }
            return(toolStripMenuItem);
        }
Пример #2
0
        public static Button botonMenu(VentasModel.Entities.Menu menu)
        {
            Button boton = new Button();

            boton.Height    = 40;
            boton.Width     = 209;
            boton.Name      = menu.Nombre;
            boton.Text      = menu.Titulo;
            boton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(163)))), ((int)(((byte)(171)))));
            boton.Cursor    = System.Windows.Forms.Cursors.Hand;
            boton.Dock      = System.Windows.Forms.DockStyle.Top;
            boton.FlatAppearance.BorderSize         = 0;
            boton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(163)))), ((int)(((byte)(171)))));
            boton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(169)))), ((int)(((byte)(193)))), ((int)(((byte)(199)))));
            boton.FlatStyle             = System.Windows.Forms.FlatStyle.Flat;
            boton.ForeColor             = System.Drawing.Color.White;
            boton.AccessibleDescription = menu.Pagina.Nombre;
            boton.AccessibleName        = menu.Pagina.Id.ToString();
            boton.Tag = "panel" + menu.Id;
            if (menu.Padre != null)
            {
                boton.Padding = new System.Windows.Forms.Padding(35, 0, 0, 0);
            }
            else
            {
                boton.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0);
            }


            boton.Size      = new System.Drawing.Size(209, 40);
            boton.TabIndex  = 1;
            boton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            boton.UseVisualStyleBackColor = false;
            //boton.Click += new EventHandler();
            return(boton);
        }