예제 #1
0
 public menuForm(DataWindow parForm)
 {
     InitializeComponent();
     thisWindow = parForm;
     thisWindow.Resize += parentFormResize;
     thisWindow.Move += parentFormMove;
 }
예제 #2
0
        private void checkLogin_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (errorCode == 1)
            {
                MessageBox.Show("Username does not exist.", "");
            }
            if (errorCode == 2)
            {
                MessageBox.Show("Password is incorrect.", "");
            }

            if (errorCode == 3)
            {
                var dw = new DataWindow();
                dw.LoginForm = this;
                dw.LoginPassword = passBox.Text;
                dw.LoginUserName = usernameBox.Text;
                dw.allChapters = chapters;
                dw.Show();
                dw.Activate();
                this.Hide();
                this.usernameBox.Clear();
                this.passBox.Clear();
                this.usernameBox.Focus();
            }
            if (errorCode == 4)
            {
                MessageBox.Show("A problem occured while trying to log in. Error message: " + e.Result.ToString(), "");
            }
            loading.Hide();
        }