I got "LogInform" form. which has some labels, two text boxes (username and password). and a button "log in". size of form is (1149, 847).
When a user clicks on the button I have a SQL function that checks if the user exists in the database.
//log in to user
private void bunifuThinButton21_Click(object sender, EventArgs e)
{
if(ConsoleApp2.UsersDB.userExists(this.userName.Text,this.passWord.Text))
{
this.Hide();
}
else
{
bunifuThinButton22.Visible = false;
wrongUser.Visible = true;
timer2.Enabled = true;
}
}
and the SQL function (userExists) :
public static bool userExists(string userName,string passWord)
{
DataTable d1;
string com = "SELECT * FROM users where user_name='" + userName + "'AND user_password='"+passWord+"'";
d1 = oledbhelper.GetTable(com);
if (d1.Rows.Count == 0)
{
return false;
}
return true;
}
After the click everything goes like it should except for one thing - The window gets smaller by itself, there is no code that makes the window smaller after the click. I don't understand why it does it. For those who don't understand what I mean, I made 20 sec video(where I start the form and put in some incorrect names and passwords and then press the button): youtube vid
I tried to set the "MinumumSize" with the regular size numbers, I tried to set "AutoSize" to false, I tried to set the Size of the window after it gets smaller(logInForm.size = new size(x,y)), I tried every possible way! I cant understand why it does it ); thanks for the help, hope I explained well enough..