Beispiel #1
0
        public string ShowMiniForm()
        {
            Table_Parts f = new Table_Parts();

            f.ShowDialog();
            string work = ""; //文字格納用
            int    cnt  = 1;  //テキストボックス用カウント
            int    row  = int.Parse(f.row_Box.Text);
            int    col  = int.Parse(f.col_Box.Text);

            try
            {
                string receiveText = "<table border=\"1\">" + "\r\n";
                if (row <= 4 && col <= 9) //列が4行以下行が9行以下
                {
                    for (int i = 0; i < col; i++)
                    {
                        receiveText += "  <tr>" + "\r\n";
                        for (int j = 0; j < row; j++)
                        {
                            work         = ((TextBox)f.Controls[string.Format("tb{0}", cnt)]).Text;
                            receiveText += "    <td>" + work + "</td>" + "\r\n";
                            cnt++;
                        }

                        work         = "";
                        receiveText += "  </tr>" + "\r\n";
                    }
                    receiveText += "</table>";
                }
                f.Dispose();
                return(receiveText);
            }
            catch (Exception e)
            {
                return(e.ToString());
            }
        }
Beispiel #2
0
        /*
         *
         */
        private void insert_Parts(string sel)
        {
            Text_parts  tp  = new Text_parts();  //テキスト
            EM_Parts    ep  = new EM_Parts();    //テキストの強調
            Hyper_Parts hpp = new Hyper_Parts(); //ハイパーテキスト
            Img_Parts   ip  = new Img_Parts();   //画像
            OL_Parts    op  = new OL_Parts();    //順序のあるリスト
            UL_Parts    up  = new UL_Parts();    //順序のないリスト
            H_Parts     hp  = new H_Parts();     //見出し
            B_Parts     bp  = new B_Parts();     //太字
            Table_Parts tbp = new Table_Parts(); //テーブル

            //* 新規追加案
            CSS_Parts     cssp  = new CSS_Parts();     //CSS参照
            TextBox_Parts tboxp = new TextBox_Parts(); // テキストボックス
            Button_Parts  btnp  = new Button_Parts();  // ボタン<button>

            //部品選択分岐-----------------------------------------------
            if (sel == "1") //テキスト
            {
                result = tp.ShowMiniForm();
                writer_html(result, 0);
                cnt++; //次の行へ
            }

            if (sel == "2") //テキストの強調
            {
                result = ep.ShowMiniForm();
                writer_html(result, 0);
                cnt++; //次の行へ
            }

            if (sel == "3") //ハイパーテキスト
            {
                result = hpp.ShowMiniForm();
                writer_html(result, 0);
                cnt++; //次の行へ
            }

            if (sel == "8")
            {
                            //画像
                {
                    result = ip.ShowMiniForm();
                    writer_html(result, 0);
                    cnt++; //次の行へ
                }
            }

            if (sel == "6") //順序のあるリスト
            {
                result = op.ShowMiniForm();
                writer_html(result, 0);
                cnt++; //次の行へ
            }

            if (sel == "7") //順序のないリスト
            {
                result = up.ShowMiniForm();
                writer_html(result, 0);
                cnt++; //次の行へ
            }

            if (sel == "0") //見出し
            {
                result = hp.ShowMiniForm();
                writer_html(result, 0);
                cnt++;      //次の行へ
            }
            if (sel == "4") //太字
            {
                result = bp.ShowMiniForm();
                writer_html(result, 0);
                cnt++; //次の行へ
            }

            if (sel == "5") //テーブル
            {
                result = tbp.ShowMiniForm();
                writer_html(result, 0);
                cnt++; //次の行へ
            }

            //* 追加分
            if (sel == "9") //CSS参照
            {
                result = cssp.ShowMiniForm();
                writer_html(result, 0);
                cnt++; //次の行へ
            }

            if (sel == "10") //テキストボックス
            {
                result = tboxp.ShowMiniForm();
                writer_html(result, 0);
                cnt++; //次の行へ
            }

            if (sel == "11") //ボタン
            {
                result = btnp.ShowMiniForm();
                writer_html(result, 0);
                cnt++; //次の行へ
            }

            //部品選択分岐-----------------------------------------------
        }