[2005] Code for a keystroke
Can someone please tell me what the code is for a keystroke?
eg I was following a VB 6 tutorial on a program and it had this code in it:
SendKeys Text1.Text
it is supposed to type the text into the specified window of whatever text is in Text1 but I am assuming the SendKeys code has changed since VB 6 because it comes up an error now. Can some please post the VB 2005 code for the same axction?
Re: [2005] Code for a keystroke
VB Code:
System.Windows.Forms.SendKeys.Send("A")
I would suggest searching the MSDN before posting questions. It should show this method in the first few results.
Re: [2005] Code for a keystroke
System.Windows.Forms.SendKeys.Send(Textbox1.text) ...in .net it's textbox not just text1
Re: [2005] Code for a keystroke
Quote:
Originally Posted by OMITT3D
System.Windows.Forms.SendKeys.Send(Textbox1.text) ...in .net it's textbox not just text1
Um, Textbox1, textbox, and text1 are just names that the programmer created. He can call it text1 all he wants.
I can name a TextBox MySuPeRaNnOyInGaLtErNaTiNgCaPsVaRbOx
System.Windows.Forms.SendKeys.Send(MySuPeRaNnOyInGaLtErNaTiNgCaPsVaRbOx.Text) works just fine
Re: [2005] Code for a keystroke
thanks for all the help, I had never used msdn before but it semms helpful, from what i have used you dont actuall need the "system.windows.forms" part, just using "SendKeys.Send(textbox1.text)" worked for me