How to determine Text_Changed by user?

JassimRahmaJassimRahma USMember ✭✭✭✭


I have the following Entry controls.

First two are clear I guess

The display name is any display name the user choose but by default I want it to be the EntryFirstname + EntryLastName so the first time the user types his first name and last name then the display name will be populated but if the user decided to change the display to anything else then even f the user types or changes the first name and last name it should not change the display name because the user has already decided what is the display name for him

So it's something like if there is a KeyPress in the DisplayName then no changes to be made

I tried this:

private void TextBoxEnterChannelName_TextChanged(object sender, TextChangedEventArgs e)
    if (channel_name_changed == false)
        TextBoxSignupChannelName.Text = TextBoxSignupFirstName.Text + " " + TextBoxSignupLastName.Text;

private void TextBoxSignupChannelName_TextChanged(object sender, TextChangedEventArgs e)
    channel_name_changed = true;

but this won't work because channel_name_changed will be fired on the first character typed inside the first name and last name then it will stop

Kindly help...


Best Answer


  • JassimRahmaJassimRahma USMember ✭✭✭✭

    Yes that is perfect


Sign In or Register to comment.