using DeviceLibrary;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AutoScanAndLabel
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            LogUtil.info("开始初始化");
            MainControl mc = new MainControl();
            AddForm("控制", mc);
            IOControl ioc = new IOControl();
            AddForm("IO调试", ioc);
            AxisControl ac = new AxisControl();
            AddForm("伺服调试", ac);

        }
        private void AddForm(string text, UserControl form)
        {
            //text = text.PadLeft(10, ' ');
            TabPage lineTabPage = new TabPage(text);
            // lineTabPage.AutoScroll = true;
            //lineTabPage.Tag = robot;
            Panel linePan = new Panel();
            linePan.Dock = DockStyle.Fill;
            linePan.AutoScroll = true;
            lineTabPage.Controls.Add(linePan);
            //form.FormBorderStyle = FormBorderStyle.None;
            //form.TopLevel = false;
            linePan.Controls.Add(form);
            form.Dock = DockStyle.Fill;
            linePan.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left)));
            form.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left)));
            form.Show();
            //tabPageList.Add(lineTabPage);
            tabControl1.Controls.Add(lineTabPage);
        }
    }
}