WPF Windows Application RRS feed

  • Question

  • Hi,

    I have 2 textboxes and a 'Check' button.  It's basically a login form.  I double clicked the 'MouseDown' event for the check button to add the code as follows.
    if(this.password.Text == this.username.text + "abc")
    MessageBox.Show("You did it!");
    However it wont let me do this.. Is there another way I can do it?  Thanks.
    Sunday, August 23, 2009 5:59 PM

All replies

  • If its a Button control, try responding to the "Click" event instread of the "MouseDown" event.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, August 24, 2009 12:42 AM
  • You can also try the "PreviewMouseLeftButtonUp" or" PreviewMouseLeftButtonDown" triggers.
    Monday, August 24, 2009 3:17 PM
  • Isn't a password box using Password instead of Text?

    (this.password.Password == this.username.text + "abc")
      MessageBox.Show("You did it!");
    Monday, August 24, 2009 7:27 PM