Wuschba

Hi. I use System.Windows.Forms.SendKeys.Send to send some text to anothers application editor-window, which works fine.

The problem occurs when the text is sent while the user holds down the shift-key.

Example:
I want to send "123456 Hello"

User holds shift-key all the time.
The first time I send the text, the editor-window shows: "!"∫$%& Hello".
The second time (and all following times) I send the text, the editor-window shows: "123456 Hello".

Why is it wrong the first time and right the next times although the shift-key has not been released all the time If it is always the same, I could ajust the text I send when the shift-key has been pressed, but with this I see no chance. What can I do



Re: Windows Forms General System.Windows.Forms.SendKeys.Send and SHIFT

Yu Guo 每 MSFT

Hi, Wuschba,

I cannot reproduct the problem,

It works fine in my Computer like

Code Snippet

private void textBox1_MouseEnter(object sender, EventArgs e)
{
SendKeys.Send("123456 Hello");
}

Could you please post more codes

Regards






Re: Windows Forms General System.Windows.Forms.SendKeys.Send and SHIFT

Wuschba

Thanks for your reply. I hooked the keyboard to catch keystrkokes like "shift+f2". In that I call SendKeys.Send("123456 Hello");

I can try to put the code into a small project and post it here.