⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 swatch_add.cs

📁 基于BP算法的贝叶斯网络参数学习
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace bs
{
    public partial class Swatch_add : Form
    {
        public int num_of_TextBox=0;//输入节点数量
        public int num_of_TextBox1 = 0;//输出节点数量
        public TextBox[] arTextBox;
        public Label [] arLabel;
        public int leftPos;
        public int topPos;
        public Swatch_add()
        {
            InitializeComponent();
            this.leftPos = 20;
            this.topPos = 20;
        }

        private void Swatch_add_Load(object sender, EventArgs e)
        {
            if (this.num_of_TextBox != 0)
            {
                arTextBox = new TextBox[num_of_TextBox1 + num_of_TextBox];
                arLabel = new Label[num_of_TextBox1 + num_of_TextBox];
                for (int i = 0; i < num_of_TextBox+num_of_TextBox1; i++)
                {
                    arTextBox[i] = new TextBox();
                    arTextBox[i].Height = 15;
                    arTextBox[i].Width = 150;
                    arTextBox[i].Location = new Point(this.leftPos + 200, this.topPos);

                    arLabel[i]=new Label();
                    arLabel[i].Height = 20;
                    arLabel[i].Width = 100;
                    arLabel[i].Text = "样本第"+(i+1).ToString()+"个输入值";
                    arLabel[i].Location = new Point(this.leftPos + 50, this.topPos);
                    arLabel[i].TextAlign = ContentAlignment.BottomLeft;
                    this.topPos += 30;
                }
                for (int i = 0; i < num_of_TextBox1; i++)
                {
                    arLabel[num_of_TextBox + i].Text = "样本第" + (i+1).ToString() + "个输出值";
                }
                    foreach (TextBox tb in arTextBox)
                    {
                        //tb.Height = 20;
                        //tb.Width = 50;
                        //tb.Location = new Point(this.leftPos+60, this.topPos);
                        this.Controls.Add(tb);
                        //this.topPos += 30;
                    }
                //this.topPos=20;
                foreach (Label lb in arLabel)
                {
                    //lb.Height = 20;
                    //lb.Width = 30;
                    //lb.Text = "样本输入值";
                    //lb.Location = new Point(this.leftPos + 20, this.topPos);
                    this.Controls.Add(lb);
                    //this.topPos += 30;
                }
            }
            //MessageBox.Show(num_of_TextBox.ToString());
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -