|
-
Mar 31st, 2006, 01:27 PM
#1
Thread Starter
Member
[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?
-
Mar 31st, 2006, 01:31 PM
#2
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.
-
Mar 31st, 2006, 01:35 PM
#3
Hyperactive Member
Re: [2005] Code for a keystroke
System.Windows.Forms.SendKeys.Send(Textbox1.text) ...in .net it's textbox not just text1
-
Mar 31st, 2006, 01:58 PM
#4
Re: [2005] Code for a keystroke
 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
-
Mar 31st, 2006, 04:44 PM
#5
Thread Starter
Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|