private static int AddComboBox(Control control, ConfigurationColumnDto fo, int position) { var lbl = new Label { Text = fo.Title, AutoSize = true, Name = $"lbl_{fo.Name}_{fo.Id}", Parent = control }; var cbx = new ComboBox { Name = $"{fo.Name}_{fo.Id}", TabIndex = fo.Index, AutoSize = true, Parent = control, DataSource = fo.EnableValues, ValueMember = "Id", DisplayMember = "Value" }; lbl.Location = new System.Drawing.Point(20, position); cbx.Location = new System.Drawing.Point(lbl.Width + 20, position); position += 40; return(position); }
public static int GetComponent(ConfigurationColumnDto column, Control control, int position) { if (column.Component == ComponentAllowed.RadioButton) { var group = AddGroupBox(control, column); group.SuspendLayout(); int i = 20; foreach (var item in column.EnableValues.OrderByDescending(a => a.Id)) { var radio = new RadioButton { Name = $"{column.Name}_{column.Id}_{item.Id}", Text = item.Value, Parent = group, AutoSize = true }; radio.Location = new Point(i, 20); position += 40; i += radio.Width; } group.ResumeLayout(); } return(position); }
public static void GetComponent(ConfigurationColumnDto column, TabPage tabPage) { if (column.Component == ComponentAllowed.DropDownList) { CreateComponent(column.Name, column.Title, column.EnableValues, tabPage); } }
public static int GetComponent(ConfigurationColumnDto column, Control control, int position) { if (column.Component == ComponentAllowed.CheckBox) { var group = AddGroupBox(control, column); group.SuspendLayout(); int i = 20; foreach (var item in column.EnableValues) { var checkBox = new CheckBox { Name = $"{column.Name}_{column.Id}_{item.Id}", Text = item.Value, Parent = group, AutoSize = true, Tag = item.Id }; checkBox.Location = new Point(i, 20); position += 40; i += checkBox.Width; } group.ResumeLayout(); } return(position); }
public static void GetComponent(ConfigurationColumnDto column, TabPage tabPage, ref int position) { if (column.Component == ComponentAllowed.TextBox) { CreateComponent(column, ref position, tabPage); } }
private static GroupBox AddGroupBox(Control control, ConfigurationColumnDto column) { GroupBox grp = new GroupBox { Text = column.Title, Dock = DockStyle.Top, Name = $"grp_{column.Group}", AutoSizeMode = AutoSizeMode.GrowAndShrink }; control.Controls.Add(grp); return(grp); }
private static void CreateComponent(ConfigurationColumnDto column, ref int position, Control ctrlParent) { var lbl = new Label { Text = column.Title, AutoSize = true, Name = $"lbl_{column.Name}_{column.Id}", Parent = ctrlParent }; var txt = new TextBox { Name = $"{column.Name}_{column.Id}", TabIndex = column.Index, AutoSize = true, Parent = ctrlParent }; lbl.Location = new System.Drawing.Point(20, position); txt.Location = new System.Drawing.Point(lbl.Width + 20, position); position += 40; }
private static void AddTextBox(Control control, ConfigurationColumnDto fo, ref int position_y, ref int position_x) { Label lbl = new Label(); lbl.Text = fo.Title; lbl.AutoSize = true; lbl.Name = $"lbl_{fo.Name}_{fo.Id}"; lbl.Parent = control; TextBox txt = new TextBox(); txt.Name = $"{fo.Name}_{fo.Id}"; txt.TabIndex = fo.Index; txt.AutoSize = true; txt.Parent = control; txt.ReadOnly = fo.ReadOnly; lbl.Location = new System.Drawing.Point(position_x, position_y); position_x += lbl.Width; txt.Location = new System.Drawing.Point(position_x, position_y); position_x += txt.Width; position_y += 40; }
protected virtual TControl MontarControle(ConfigurationColumnDto columnDto) { throw new NotImplementedException(); }
protected override TextBox MontarControle(ConfigurationColumnDto columnDto) { throw new NotImplementedException(); }