private void button1_Click(object sender, EventArgs e) { // Tồn kho Form f = new Form() { Text = "Tồn kho" }; ProductSearchControl p = new ProductSearchControl(); p.Dock = DockStyle.Fill; f.AutoSize = true; f.Controls.Add(p); f.Width = 800; f.Height = 600; f.Show(); }
public ProductView() { InitializeComponent(); //pnlMain.FlowDirection = FlowDirection.LeftToRight; ////pnlMain.AutoSize = true; ProductSearchControl sc = new ProductSearchControl(); sc.Dock = DockStyle.Fill; ProductEditorControl pec = new ProductEditorControl(); pec.Dock = DockStyle.Fill; // Add Call back to bridge Product object between 2 controls sc.addCallbacksFn(pec); splitContainer.Panel1.Controls.Add(sc); splitContainer.Panel2.Controls.Add(pec); //splitContainer.SuspendLayout(); //sc.Dock = DockStyle.Bottom; //pec.Dock = DockStyle.Fill; //pnlMain.Controls.Add(sc); //pnlMain.Controls.Add(pec); //pnlMain.SuspendLayout(); }