Exemplo n.º 1
0
        public WinConstant()
        {
            BackColor = RedGreenBlue.Color2;
            Controls.Add(PanelButtons);
            Controls.Add(DeleteButton);
            Controls.Add(CreateButton);
            Controls.Add(TextBoxChange);

            DeleteButton.AddColor1();
            CreateButton.AddColor1();
            CreateButton.Click += new EventHandler(delegate(object sender, EventArgs e) { CreateVariable(); });
            DeleteButton.Click += new EventHandler(delegate(object sender, EventArgs e) { DeleteVariable(); });

            PanelButtons.ControlAdded += new ControlEventHandler(delegate(object sender, ControlEventArgs e) {
                foreach (LabelCustom i in ((Panel)sender).Controls)
                {
                    if (((Panel)sender).Controls.Count > 11)
                    {
                        i.Width = 195; ((Panel)sender).AutoScroll = true;
                    }
                    else
                    {
                        i.Width = 214; ((Panel)sender).AutoScroll = false;
                    }
                }
            });

            // PanelButtons
            PanelButtons.Location          = new Point(7, 72);
            PanelButtons.Margin            = new Padding(7);
            PanelButtons.Name              = "PanelButtons";
            PanelButtons.Size              = new Size(228, 444);
            PanelButtons.TabIndex          = 0;
            PanelButtons.BackColor         = RedGreenBlue.Color1;
            PanelButtons.AutoScrollMinSize = new Size(10, 444);
        }