Which textbox event will generate an email when the textbox is clicked?

28 Views Asked by At

All I want to do is input a Forename and a Surname into two textboxes and in the Email textbox generate an email address using the forename and surname. It isn't hard at all but none of the events I've tried have worked. I've even dummed it down so that if any of the events happen the email textbox should just say "hello".

None of these event have worked:

private void EmailAddressInputTextbox_TextChanged(object sender, EventArgs e)
    {
        EmailAddressInputTextbox.Text = ("Hello");
    }

    private void EmailAddressInputTextbox_GotFocus(object sender, EventArgs e)
    {
        EmailAddressInputTextbox.Text = ("Hello");
    }

    private void EmailAddressInputTextbox_Enter(object sender, EventArgs e)
    {
        EmailAddressInputTextbox.Text = ("Hello");
    }

    private void EmailAddressInputTextbox_Click(object sender, EventArgs e)
    {
        EmailAddressInputTextbox.Text = ("Hello");
    }

Even tried:

 private void SurnameInputTextbox_Leave(object sender, EventArgs e)
        {
            EmailAddressInputTextbox.Text = ("Hello");
        }

Ideally I want the textbox to be filled when it has been clicked on and can be typed in but so far nothing happens...

0

There are 0 best solutions below