Control addwarningcontrol(int x, int y, CheckListItem item, bool hideforchild = false) { var desctext = item.Description; var texttext = item.DisplayText(); var height = TextRenderer.MeasureText(desctext, this.Font).Height; var x0 = (int)(Width * 0.95); var x1 = (int)(x0 * 0.5); var x2 = (int)(x0 * 0.4); var x3 = (int)(x0 * 0.1); GroupBox gb = new GroupBox() { Text = "", Location = new Point(x, y), Size = new Size(x0, 17 + height), Name = "gb" + y }; Label desc = new Label() { Text = desctext, Location = new Point(5, 9), Size = new Size(x1, height), Name = "udesc" + y }; Label text = new Label() { Text = texttext, Location = new Point(desc.Right, 9), Size = new Size(x2, height), Name = "utext" + y }; CheckBox tickbox = new CheckBox() { Checked = item.checkCond(item), Location = new Point(text.Right, 7), Size = new Size(21, 21), Name = "utickbox" + y }; desc.Tag = text.Tag = tickbox.Tag = new internaldata { CLItem = item, desc = desc, text = text, tickbox = tickbox }; gb.Controls.Add(desc); gb.Controls.Add(text); gb.Controls.Add(tickbox); panel1.Controls.Add(gb); y = gb.Bottom; if (item.Child != null) { //return addwarningcontrol(x += 5, y, item.Child, true); } return(gb); }
Control addwarningcontrol(int x, int y, CheckListItem item, bool hideforchild = false) { var desctext = item.Description; var texttext = item.DisplayText(); var height = 21; if (desctext.Length > 25 || texttext.Length > 25) { height = 42; } Label desc = new Label() { Text = desctext, Location = new Point(x, y), Size = new Size(150, height), Name = "udesc" + y }; Label text = new Label() { Text = texttext, Location = new Point(desc.Right, y), Size = new Size(150, height), Name = "utext" + y }; CheckBox tickbox = new CheckBox() { Checked = item.checkCond(item), Location = new Point(text.Right, y), Size = new Size(21, 21), Name = "utickbox" + y }; desc.Tag = text.Tag = tickbox.Tag = new internaldata { CLItem = item, desc = desc, text = text, tickbox = tickbox }; panel1.Controls.Add(desc); panel1.Controls.Add(text); panel1.Controls.Add(tickbox); y = desc.Bottom; if (item.Child != null) { //return addwarningcontrol(x += 5, y, item.Child, true); } return(desc); }
Control addwarningcontrol(int x, int y, CheckListItem item, bool hideforchild = false) { var desctext = item.Description; var texttext = item.DisplayText(); var height = 21; if (desctext.Length > 25 || texttext.Length > 25) height = 42; Label desc = new Label() { Text = desctext, Location = new Point(x, y), Size = new Size(150, height), Name = "udesc" + y }; Label text = new Label() { Text = texttext, Location = new Point(desc.Right, y), Size = new Size(150, height), Name = "utext" + y }; CheckBox tickbox = new CheckBox() { Checked = item.checkCond(item), Location = new Point(text.Right, y), Size = new Size(21, 21), Name = "utickbox" + y }; desc.Tag = text.Tag = tickbox.Tag = new internaldata { CLItem = item, desc = desc, text = text, tickbox = tickbox }; panel1.Controls.Add(desc); panel1.Controls.Add(text); panel1.Controls.Add(tickbox); y = desc.Bottom; if (item.Child != null) { //return addwarningcontrol(x += 5, y, item.Child, true); } return desc; }
Control addwarningcontrol(int x, int y, CheckListItem item, bool hideforchild = false) { var desctext = item.Description; var texttext = item.DisplayText(); var height = TextRenderer.MeasureText(desctext, this.Font).Height; GroupBox gb = new GroupBox() { Text = "", Location = new Point(x,y), Size = new Size(330, 17 + height), Name = "gb" + y }; Label desc = new Label() { Text = desctext, Location = new Point(5, 9), Size = new Size(150, height), Name = "udesc" + y }; Label text = new Label() { Text = texttext, Location = new Point(desc.Right, 9), Size = new Size(150, height), Name = "utext" + y }; CheckBox tickbox = new CheckBox() { Checked = item.checkCond(item), Location = new Point(text.Right, 7), Size = new Size(21, 21), Name = "utickbox" + y }; desc.Tag = text.Tag = tickbox.Tag = new internaldata { CLItem = item, desc = desc, text = text, tickbox = tickbox }; gb.Controls.Add(desc); gb.Controls.Add(text); gb.Controls.Add(tickbox); panel1.Controls.Add(gb); y = gb.Bottom; if (item.Child != null) { //return addwarningcontrol(x += 5, y, item.Child, true); } return gb; }