private void button1_Click(object sender, EventArgs e)
        {
            Profile profile = new Profile();

            profile.TopLevel = false;
            ParentPanel.Controls.Clear();
            ParentPanel.Controls.Add(profile);
            profile.FormBorderStyle = FormBorderStyle.None;
            profile.Dock            = DockStyle.Fill;
            profile.Show();
            resetColor();
            ((Button)sender).BackColor = Color.Tomato;
        }
예제 #2
0
 private void btProfile_Click(object sender, EventArgs e)
 {
     if (profile == null)
     {
         if (textBox2.Text != "")
         {
             profile = new Profile(this, textBox2.Text);
             //profile.StartPosition = FormStartPosition.CenterParent;
             profile.Show();
             profile.Location = new Point(this.Left + this.Width, this.Top);
         }
         else
         {
             MessageBox.Show("Vui lòng chọn item");
         }
     }
 }