Form will open by pressing the Enter key or Space Bar [Resolved]

Posted by Agopi.net under C# on 2/4/2012 | Points: 10 | Views : 3937 | Status : [Member] | Replies : 8
Hi

After the main form opened, we hit the enter key or space bar then another form will be open.

Could you please give me the idea or any reference link or coding in C SHARP

Gopi A




Responses

Posted by: Naraayanan on: 2/10/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi,
It is possible .

Change Form Property:
KeyPreview = true
and
       private void Form1_KeyPress(object sender, KeyPressEventArgs e)

{
if (e.KeyChar == 13)
{
AboutBox1 aabt = new AboutBox1();
aabt.Show();
}
}
}




Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Agopi.net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Avdesh on: 2/4/2012 [Member] Starter | Points: 25

Up
0
Down
can u explain in detail ?

Agopi.net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Agopi.net on: 2/4/2012 [Member] Starter | Points: 25

Up
0
Down
Sorry for not express my question in right way.

I want to open the another form while i press the enter key or space bar once we run the application.
EX: I execute the form1 then i will press the enterkey for open the form2.



Agopi.net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Avdesh on: 2/4/2012 [Member] Starter | Points: 25

Up
0
Down
after running your application if u submit the form or press the button then u want another form will open?
is it correct?

Agopi.net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Agopi.net on: 2/4/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

Again i am sorry...

In the first form there is no controls like "button, textbox, combobox, listbox etc.... It's plain form (form1). Here i need to open the another form (form2) by press the enter key of spacebar. I start my work from form2.

Above is the exact what i need.

Agopi.net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Avdesh on: 2/4/2012 [Member] Starter | Points: 25

Up
0
Down
There is no solution to your problem.You have to put a single button for that particular requirement of yours
Thanks Regards
AVDESH

Agopi.net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Agopi.net on: 2/10/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Lakshmi,

Thankyou very much. It's working fine.

Thanks and Regards,
Gopi A.

Agopi.net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naraayanan on: 2/13/2012 [Member] Starter | Points: 25

Up
0
Down
hi,
thanks.and Please mark my answer

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Agopi.net, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response