예제 #1
0
        private TemplateInterface ReturnInterface(Stocks stock)
        {
            TemplateInterface tempInterface = new TemplateInterface(_x, _y, _nameSize, stock, _ourPanel);

            //tempInterface.CreateRow(_x, _y, stock, _ourPanel);
            //_interfaceList.Add(tempInterface);
            return(tempInterface);
        }
예제 #2
0
        readonly int[] width = { 14, 141, 155 }; //Расстояние между элементами интерфейса

        public TemplateInterface(int x, int y, int nameSize, Stocks stock, Panel stockConteiner)
        {
            List <string> nameList = stock.GetName();

            //this.SuspendLayout();

            // Имя поставщика

            label1.AutoSize  = true;
            label1.BackColor = System.Drawing.SystemColors.Control;
            label1.Location  = new System.Drawing.Point(x, y);
            label1.Name      = label1Name;
            label1.AutoSize  = false;
            label1.Size      = new System.Drawing.Size(nameSize, 13);
            label1.TabIndex  = 0;
            label1.Text      = nameList[0];

            // Название файла

            textBox1.Location   = new System.Drawing.Point(x + nameSize + width[0], y - 3);
            textBox1.Name       = textBoxName;
            textBox1.Size       = new System.Drawing.Size(100, 20);
            textBox1.TabIndex   = 1;
            textBox1.Text       = nameList[1];
            textBox1.AllowDrop  = true;
            textBox1.DragDrop  += new DragEventHandler(Form1.Form_DragDrop);
            textBox1.DragEnter += new DragEventHandler(Form1.Form_DragEnter);
            textBox1.DragLeave += new EventHandler(Form1.Form_DragLeave);

            // Кнопка старого файла

            bt1.Location = new System.Drawing.Point(x + nameSize + width[2], y - 3);
            bt1.Name     = nameList[1];
            bt1.Size     = new System.Drawing.Size(45, 20);
            bt1.TabIndex = 3;
            bt1.Text     = "Old";
            bt1.UseVisualStyleBackColor = true;
            bt1.Click += new System.EventHandler(Form1.btn_Send_Old);

            // Статус

            label2.AutoSize = true;
            label2.Location = new System.Drawing.Point(x + nameSize + width[1], y);
            label2.Name     = label2Name;
            label2.Size     = new System.Drawing.Size(35, 13);
            label2.TabIndex = 2;
            label2.Text     = "";

            stockConteiner.Controls.Add(label1);
            stockConteiner.Controls.Add(textBox1);
            stockConteiner.Controls.Add(label2);
            stockConteiner.Controls.Add(bt1);
        }