TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
pasan herath
NA
21
28.1k
Set function keys to button click
Oct 11 2013 12:58 AM
I need to set f2 key to button on my winform
private void UserPopUp_KeyPress(object sender, KeyPressEventArgs e)
{
if(e.KeyChar == (char)Keys.Enter)
{
button3.PerformClick();
}
if (e.KeyChar == (char)Keys.F1)
{
MessageBox.Show("hi");
uaddbtn.PerformClick();
}
if (e.KeyChar == (char)Keys.F3)
{
button1.PerformClick();
}
if (e.KeyChar == (char)Keys.Escape)
{
MessageBox.Show("hi");
}
}
but here f1 and f3 buttons are not working.Enter and escape is working
please help to set these f1 and f3 keys to perform above actions
Reply
Answers (
1
)
Audience and Seat#
e.KeyCode property