C# 发送“LShift+ctrl”和“rshift+ctrl”并在richtextbox中检测

C# 发送“LShift+ctrl”和“rshift+ctrl”并在richtextbox中检测,c#,winforms,richtextbox,C#,Winforms,Richtextbox,我用以下代码检测L换档和R换档: if ((GetAsyncKeyState(Keys.LShiftKey) < 0)) { MessageBox.Show("Left Shift"); } if ((GetAsyncKeyState(Keys.RShiftKey) < 0)) { MessageBox.Show("Right Shift"); } 但这段代码的工作方式类似于leftshift+ctrl,我需要rightshift+ctrl。如何发送rightshi

我用以下代码检测L换档和R换档:

if ((GetAsyncKeyState(Keys.LShiftKey) < 0))
{
    MessageBox.Show("Left Shift");
}
if ((GetAsyncKeyState(Keys.RShiftKey) < 0))
{
    MessageBox.Show("Right Shift");
}
但这段代码的工作方式类似于leftshift+ctrl,我需要rightshift+ctrl。如何发送rightshift+ctrl?

试试这个

SendKeys.Send("(+^)");

此代码与SendKeys类似;我想发送rightshift+ctrl谢谢你的帮助
SendKeys.Send("(+^)");