private void SwitchToForm2() { // this ở đây như là một object thể hiện cho class StartForm1 this.Hide(); StartForm2 Form2 = new StartForm2(); Form2.ShowDialog(); this.Close(); }
// Use for DrawName private void DrawName(Button name, int WidthLocation, int HeigtLocation, Color color) { StartForm2 dataStartForm2 = new StartForm2(); string btnText = ""; if (color == Color.Red) { btnText = } name = new Button() { Enabled = true, Text = Text, Font = new Font("Segoe UI", 11.25F), Location = new Point(WidthLocation, HeigtLocation), Size = new Size(100, 32), ForeColor = color, }; this.Controls.Add(name); name.BringToFront(); }