This is going to be somewhat a lengthy post, i do hope someone here can help me with this problem that i've already spent a gazillion brain cells on. >.<
I AM a student asking for help as i cannot seem to be making this work with my atrocious programming skills.
I am doing this project as part of my attachment for my diploma.
Meh.
What i've got so far is that i'm done with my UI,
(being very ugly and unprofessional looking, guess i'm going to have to come up with some background designs)
[IMG]http://img.photobucket.com/albums/v95/freakyphua/LoginSample.jpg[/IMG]
This is the code so far,
private void btnA_Click(object sender, EventArgs e)
{
if (Pwdsel == 1)
{
insertStringPass(btnA.Text, this.Password.SelectionStart);
}
else
{
insertStringUser(btnA.Text, this.Username.SelectionStart);
}
}
private void btnB_Click_1(object sender, EventArgs e)
{
if (Pwdsel == 1)
{
insertStringPass(btnB.Text, this.Password.SelectionStart);
}
else
{
insertStringUser(btnB.Text, this.Username.SelectionStart);
}
}
private void btnC_Click(object sender, EventArgs e)
{
if (InputCaps == 0)
{
if (Pwdsel == 1)
{
insertStringPass(btnC.Text, this.Password.SelectionStart);
}
else
{
insertStringUser(btnC.Text, this.Username.SelectionStart);
}
}
}
private void btnD_Click(object sender, EventArgs e)
{
if (Pwdsel == 1)
{
insertStringPass(btnD.Text, this.Password.SelectionStart);
}
else
{
insertStringUser(btnD.Text, this.Username.SelectionStart);
}
}
private void btnE_Click(object sender, EventArgs e)
{
if (Pwdsel == 1)
{
insertStringPass(btnE.Text, this.Password.SelectionStart);
}
else
{
insertStringUser(btnE.Text, this.Username.SelectionStart);
}
}
All the buttons are similar, so putting ALL of them here would seem abit silly.
I've also added a button to switch the focus (for the lack of a better word) from the username textbox to the password textbox.
private void UserSubmit_Click(object sender, EventArgs e)
{
if (Username.Text.Length < 1)
{
MessageBox.Show("Please enter username");
}
else
{
Username.Enabled = false;
Password.Enabled = true;
LoginBtn.Enabled = true;
UserSubmit.Enabled = false;
Pwdsel = 1;
}
}
But this isn't how i want the program to be, i wanted the users to be able to click on the password textbox and be able to input their passwords using the buttons instead of having to press the submit button to switch the focus. (Emulating input with a keyboard, you just have to click on either textbox to switch the focus to type in your passwords/usernames, right? I'm trying to do the same thing.)
I've tried putting this in, but it just doesn't work!
private void Password_OnClick(object sender, EventArgs e)
{
if (Username.Text.Length < 1)
{
MessageBox.Show("Please enter username");
}
else
{
Username.Enabled = false;
Password.Enabled = true;
LoginBtn.Enabled = true;
UserSubmit.Enabled = false;
this.Password.Focus();
Pwdsel = 1;
}
}
As to why i have to program it with a on screen keyboard, it's because i'm doing this for a smart device running windows CE.
Using the OSK.exe is not a viable option for me :X
Anyhelp is appreciated! Thanks in advance :]