locked
Number pad login

    Question

  • Hi,

    I've created a login page that has a number pad (0-9) and I want it so that when a button number is pressed, it will send that number to a password box. I'm not sure how to do this.

    Thanks

    Saturday, June 7, 2014 11:32 AM

Answers

  • Hi,

    Do you mean you try to create a virtual number pad in your windows store app? If so, you can use button to set all the numbers in your number pad, when you click the button you can use button click event to send that number to a password box:

    private void button4_Click(object sender, EventArgs e)
            {
                Button button = sender as Button;
                passwordbox.Password = button.Content.ToString();
                
            }
    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, June 9, 2014 1:39 AM
  • private void button4_Click(object sender, EventArgs e)
            {
                Button button = sender as Button;
                passwordbox.Password = button.Content.ToString();
                
            }

    A minor change to what Anne Jing had suggested: if you want the content to be appended to the password box, then make it as:

    passwordbox.Password += button.Content.ToString();

    - Ram
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Monday, June 9, 2014 5:39 AM

All replies

  • Hi,

    Do you mean you try to create a virtual number pad in your windows store app? If so, you can use button to set all the numbers in your number pad, when you click the button you can use button click event to send that number to a password box:

    private void button4_Click(object sender, EventArgs e)
            {
                Button button = sender as Button;
                passwordbox.Password = button.Content.ToString();
                
            }
    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, June 9, 2014 1:39 AM
  • private void button4_Click(object sender, EventArgs e)
            {
                Button button = sender as Button;
                passwordbox.Password = button.Content.ToString();
                
            }

    A minor change to what Anne Jing had suggested: if you want the content to be appended to the password box, then make it as:

    passwordbox.Password += button.Content.ToString();

    - Ram
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Monday, June 9, 2014 5:39 AM