我得到一个3*4数 然后自动在界面上生成一个长为3,宽为4的有label组成的窗体··帮一下。

解决方案 »

  1.   

    "3*4".split('*')[0]
    "3*4".split('*')[1]
      

  2.   


    private System.Windows.Forms.Label label3;
    this.label3.Location = new System.Drawing.Point(8, 56);
    this.label3.Name = "label3";
    this.label3.Size = new System.Drawing.Size(3, 4);
      

  3.   


    把3和4取出来
    "3*4".split('*')[0] 
    "3*4".split('*')[1]然后写个循环,在里面把Lable加到上面
      

  4.   

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;namespace Lb34
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }        private void Form1_Load(object sender, EventArgs e)
            {
                Go(3, 4);
            }        private void Go(int a, int b)
            {
                for (int i = 0; i < a; i++)
                {
                    for (int j = 0; j < b; j++)
                    {
                        Label lb = new Label();
                        lb.Text = i.ToString() +"x"+j.ToString();
                        lb.Name = lb.Text;
                        lb.Left = j * 80;
                        lb.Top = i * 90;
                        this.Controls.Add(lb);
                    }
                }
            }
        }
    }
      

  5.   

    根据 传递过来的参数 创建一个form 长 和 宽 由参数来指定 。这个form  要动态的摆放12 个lable控件。