着急 请大家帮帮忙

解决方案 »

  1.   

            类似下面代码:    PictureBox pic = new PictureBox();
                pic.Parent = panel1;
                pic.Dock = DockStyle.Fill;
      

  2.   

    楼上说的都可以,直接拖进去也可以,得到值就用document.getElement("");
      

  3.   

    给你一个我以前写的方法,是动态添加radioButton的,你稍做修改就可以用了
            /// <summary>
            /// 动态创建控件及事件处理程序
            /// </summary>
            /// <param name="Datas">数据集</param>
            /// <param name="panel">Panel控件</param>
            /// <param name="rdoName">动态生成控件前缀名</param>
            private void InitComponents(string[] Datas, Panel panel, string rdoName)
            {
                panel.Controls.Clear();
                int count = 0;
                RadioButton radioButton;
                foreach (string data in Datas)
                {
                    radioButton = new RadioButton();
                    radioButton.Location = new System.Drawing.Point(20, count * 20);
                    radioButton.Name = rdoName + Datas[count];
                    radioButton.Size = new System.Drawing.Size(150, 20);
                    radioButton.TabIndex = count;
                    radioButton.Text = Datas[count];
                    radioButton.Tag = Datas[count];
                    radioButton.UseVisualStyleBackColor = true;
                    if (count == 0)
                        radioButton.Checked=true;
                    panel.Controls.Add(radioButton);
                    count++;
                }
            }
      

  4.   

    #region 生成控件
            string lblGuiNamePrefix = "lblGui_";
            string txtGuiNamePrefix = "txtGui_";
            string lblDbNamePrefix = "lblDb_";
            string txtDbNamePrefix = "txtDb_";        int last_index = 1;
            int left = 14;
            int top = 40;        void CreateNewControl()
            {
                Label lbl = new Label();
                lbl.Name = lblGuiNamePrefix + last_index.ToString();
                lbl.Text = "显示值";
                lbl.Top = top + 5;
                lbl.Left = left;
                lbl.Width = 60;
                this.Controls.Add(lbl);            TextBox txtGui = new TextBox();
                txtGui.Name = txtGuiNamePrefix + last_index.ToString();
                txtGui.Text = "";
                txtGui.Top = top;
                txtGui.Left = lbl.Right + 5;
                txtGui.Width = 80;
                this.Controls.Add(txtGui);            Label lbl2 = new Label();
                lbl2.Name = lblDbNamePrefix + last_index.ToString();
                lbl2.Text = "数据库值";
                lbl2.Top = top + 5;
                lbl2.Left = txtGui.Right + 5;
                lbl2.Width = 60;
                this.Controls.Add(lbl2);            TextBox txtDb = new TextBox();
                txtDb.Name = txtDbNamePrefix + last_index.ToString();
                txtDb.Text = "";
                txtDb.Top = top;
                txtDb.Left = lbl2.Right + 5;
                txtDb.Width = 80;
                txtDb.KeyDown += new KeyEventHandler(txtDb_KeyDown);
                this.Controls.Add(txtDb);            last_index += 1;
                top += 30;            btnCreate.Top = top;
                btnClear.Top = top;
            }        void txtDb_KeyDown(object sender, KeyEventArgs e)
            {
                if (e.KeyCode == Keys.Enter)
                {
                    CreateNewControl();
                }
            }
            #endregion
      

  5.   

    加控件时:panel.Controls.Add(...
    得到值时:遍历panel.Controls