private void SignInBtn_Click(object sender, EventArgs e) { var user = new User(); user.Login = LoginTextBox.Text; user.Password = PasswordTextBox.Text; if (user.CheckUser()) { PostsForm posts = new PostsForm(); posts.Size = this.Size; posts.StartPosition = this.StartPosition; this.Visible = false; posts.ShowDialog(); this.Visible = true; } else { MessageBox.Show("Incorrect login or password."); } }
private void PostsToolStripMenuItem_Click(object sender, EventArgs e) { PostsForm postsForm = new PostsForm(); postsForm.ShowDialog(); }