Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello
i have an event with this header
C#
private void keyEnterPressedOnBtn(object sender, KeyEventArgs e)


i want to pass enter key to this function from another place
i tried this
C#
keyEnterPressedOnBtn(null, System.Windows.Forms.SendKeys.Send("{ENTER}"));


but i have error
help me :)
Posted
Updated 18-Jan-21 2:12am
Comments
j snooze 5-Aug-14 17:09pm    
Will this work for you?
keyEnterPressedOnBtn(null, new KeyEventArgs(Keys.Enter));
M. Daban 5-Aug-14 17:12pm    
Yes thank you
post it as answer to accept

keyEnterPressedOnBtn(null, new KeyEventArgs(Keys.Enter));
 
Share this answer
 
Try this[^]
It may help you to understand more
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900