public Kit(Control control, String table_name, FormWithFieldsOptions option)
            {
                this.option     = option;
                this.control    = control;
                this.table_name = table_name;

                InitializeComponents();
            }
            public Kit(Control control, DataGridView dataGridView, FormWithFieldsOptions option)
            {
                this.option       = option;
                this.control      = control;
                this.dataGridView = dataGridView;
                this.table_name   = (dataGridView.DataSource as BindingSource).DataMember;

                InitializeComponents();
            }
 public LabelAndControls(String label_text, Control control, bool required, Button ok_btn, String table_to_open, FormWithFieldsOptions option)
 {
     this.option        = option;
     this.table_to_open = table_to_open;
     this.ok_btn        = ok_btn;
     this.required      = required;
     if (required)
     {
         this.label_text = label_text + "*";
     }
     else
     {
         this.label_text = label_text;
     }
     this.control = control;
     InitializeComponents();
 }
            public FormWithFields(String table_name, DataGridView dataGridView, FormWithFieldsOptions option)
            {
                this.option       = option;
                this.table_name   = table_name;
                this.dataGridView = dataGridView;
                SplitContainer splitContainer = new SplitContainer();

                splitContainer.Dock        = DockStyle.Fill;
                splitContainer.FixedPanel  = FixedPanel.Panel2;
                splitContainer.Orientation = Orientation.Horizontal;
                this.Controls.Add(splitContainer);
                this.Size                   = new Size(800, 500);
                flowLayoutPanel             = new FlowLayoutPanel();
                flowLayoutPanel.Dock        = DockStyle.Fill;
                flowLayoutPanel.BorderStyle = BorderStyle.FixedSingle;
                splitContainer.Panel1.Controls.Add(flowLayoutPanel);
                ok_btn      = new Button();
                ok_btn.Size = new Size(100, 20);
                if (option == FormWithFieldsOptions.edit)
                {
                    ok_btn.Text = "Изменить";
                }
                else
                {
                    ok_btn.Text = "Добавить";
                }
                ok_btn.Enabled  = false;
                ok_btn.Location = new Point(splitContainer.Width - ok_btn.Width - 20, 10);
                splitContainer.Panel2.Controls.Add(ok_btn);
                ok_btn.Click += new EventHandler(add_button_Click);
                if (option == FormWithFieldsOptions.add)
                {
                    this.Text = "Добавить запись в таблицу " + table_name;
                }
                if (option == FormWithFieldsOptions.edit)
                {
                    this.Text = "Изменить запись в таблице " + table_name;
                }
                Fill_FlowLayoutPanel();
            }
 public MyToolBar(FormWithFieldsOptions option)
 {
     this.option = option;
     InitializeMyToolBar();
     AddStandardItems();
 }