C
C#2y ago
Nikolaaa

Why is not this button working?

private void signinbtn_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(nameTxt.Text))
{
authTxt.Text = "Failed to authenticate." +
"Username can not be empty.";

}
else
{
if (String.IsNullOrEmpty(PassTxt.Text))
{
authTxt.Text = "Failed to authenticate." +
"Password can not be empty.";

}
else
{

authTxt.Text = "Success!";
//add code here!



}
}
private void signinbtn_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(nameTxt.Text))
{
authTxt.Text = "Failed to authenticate." +
"Username can not be empty.";

}
else
{
if (String.IsNullOrEmpty(PassTxt.Text))
{
authTxt.Text = "Failed to authenticate." +
"Password can not be empty.";

}
else
{

authTxt.Text = "Success!";
//add code here!



}
}
when I click Sign In nothing happens, why?
14 Replies
Buddy
Buddy2y ago
Just fix it /s Are you even subscribed to the click event?
Nikolaaa
Nikolaaa2y ago
yes
Buddy
Buddy2y ago
Are you absolutely sure? Set a breakpoint.
Nikolaaa
Nikolaaa2y ago
Nikolaaa
Nikolaaa2y ago
you mean this? I am subscribed to it if this is what you mean
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Buddy
Buddy2y ago
Set a breakpoint, just to confirm that it is being called.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Nikolaaa
Nikolaaa2y ago
It changes color when I click it
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Buddy
Buddy2y ago
Can also be that you are not calling it from the UI-Thread
Nikolaaa
Nikolaaa2y ago
oh wait, I am dumb I am so sorry, authTxt visibility was off
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Nikolaaa
Nikolaaa2y ago
I was about to set it to on in code but forgot sorry I am going to close this post now