You can use SendKeys in C # to send keys to your application. As in your case, you want to send ALT + Space keys to your application to display the System menu, for this you need to do what you need to shift focus to your form, where you want to display the system menu and use SendKeys.SendWait ( )
Note. Without moving the focus to the form in which you want to display the system menu, the command does not work properly.
Try the following code to send ALT + Space to display the system menu
this.Focus(); // Transfering focus to form SendKeys.SendWait("% "); // Sending Keys
Here,% represents ALT, and white space displays space keys, respectively.
source share