haveing trouble with keys


Jan 13, 2005
Programming Experience
Hi, im having some trouble with the sendkeys function tells me that

"sendkeys is a type and cannot be used as an expression"

is there anything similar to this in vs.net because i chould use this type in vb6 any suggestions?


SendKeys in VB.NET is a public class. Use the Send or SendWait function of that class to send the keystrokes.

code would be something like: SendKeys.Send("theKeyStrokesGoHereAsAString")
Still ^^

thanks for the help with the sendkeys.send function but when i go to run the debug it freezes.

heres what i got:


its extremely simple for now i just want to get the basics down because i always can gussy it up later...

also can someone show me how to make an exe out of all this?
well i can answer the exe portion of your question(s). whenever you run anything you've made in vb.net (dll, exe) it's always compiled for ya (unlike vb6) so just go to the project's solution folder and then the "bin" folder and there's your distributable exe file (or dll)
sharpimage said:
haha thanks but when i tryed to give that to a friendhe said he was missing a dll then he needed to have a regestry key :(



he probably has yet to install the .net framework which is a requirment of all .net apps
Well first of all, you have a Do/Loop that doesn't have a way out ( a condition to look for to exit the loop).
Also, what app are you sending the keystrokes? The SendWait function waits for the message to be processed.
If you put in a break and debug, you can see where the program is hanging.
Alright i made a entirely new program and this is what i got still getthe same problem but when i do the program gives me an error but firstthe program code:


afterwards i get this error when i go to debug it


any ideas?


im sending the keystrokes to a java applet but this is the end resultfor now im just trying to send it to notepad :). when you saytimer.tick event dont mean to be noobish but whats the tick stand forand how do i use it? also thanks for all the your giving me i reallyaprecate it.


Well first of all, there are several Timers in the .NET framework. I'm assuming you're attempting to use the System.Windows.Forms.Timer. (the others are System.Threading.Timer, used for threading, and the System.Timers.Timer which has a finer resolution).
The System.Windows.Forms.Timer has an event called Tick which is analogous to the ticking of a clock. The tick event fires for an enabled timer each time the set interval expires.
So to use a timer you create an event handler procedure. That procedure gets executed every [interval] milliseconds as long as the timer is enabled. To stop the timer, just set the enabled property to false as you've shown.
If you want to send the keystrokes a set number of times with a pause, the timer isn't neccesary. Use System.Threading.Thread.Sleep(intervalInMilliseconds) to pause for the specified time.

The stack overflow exception may be caused by sending too many keystrokes too quickly.