Skip to content

Html editor using mshtml

anuruddha pandey

Asked May 3, 2015, 3:51 AM EDT1 answer
Share
LinkedInX
how to multiple table column width  in dynamic  created numeric updown control 





C#
                for (int i = 0; i < txtno; i++)
                {


                    Label b = new Label();
                    b.Text = ("Col" + (i + 1)).ToString();
                    b.Location = new Point(pointX, pointY);
                    b.Width = 34;
                    // b.Width = 35;
                    b.Height = 20;
                    columnwid.flowLayoutPanel1.Controls.Add(b);
                    columnwid.flowLayoutPanel1.Show();
                    pointX += 36;
               // }
                        //TextBox a = new TextBox();
                        //HtmlElement row2 = table.GetElementsByTagName("tr")[0];
                        //foreach (HtmlElement cell2 in row2.GetElementsByTagName("td"))
                        //{
                        NumericUpDown a = new NumericUpDown();


                        //a.Value=(Math.Round(System.Convert.ToDecimal(elementCell.style.width)));
                        a.Location = new Point(pointX, pointY);
                        columnwid.flowLayoutPanel1.Controls.Add(a);
                        columnwid.flowLayoutPanel1.Show();
                        a.Width = 45;
                        //a.Width = 35;
                        a.Height = 20;
                        pointX += 36;
                        columnwid.radioWidthPixel.Checked = true;

                        //int width = Convert.ToInt32(cellSelect.style.width);
                        object width = cellSelect.style.width;
                           // string width = cell2.GetAttribute("width").ToString();
                        //if (width == null)
                        //{
                        //    width = cellSelect.width;
                        //    // width = Convert.ToInt32(cellSelect.width);
                        //}



                        if (width != null)
                        {


                            value = decimal.Parse(width.ToString().Replace("%", string.Empty).Replace("px", string.Empty).Replace("pt", string.Empty));
                            if (value > 0)
                            {
                                a.Value = value;
                                j = a.Value;


                                // columnwid.radioWidthPixel.Checked = true;
                            }
                        }

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    how to get webbrowser table multiple column width  in dynamic  created numeric updown control using c# 
    0