[Help]My Project[Solved]

Posts 1–4 of 4 · Page 1 of 1
[Help]My Project[Solved]
Like im trying to make one simple code but it have 6 erros...

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
wshShell = wscript.CreateObject("WScript.Shell")
Do
wscript.sleep(100)
wshshell.sendkeys("{CAPSLOCK}")
wshshell.sendkeys("{NUMLOCK}")
wshshell.sendkeys("{SCROLLLOCK}")
Loop
End Sub
End Class
This is my code... i tried 2 make it on a .txt and it work .vbs worked... but when i try to convert it to visual basic it got 6 errors

Code:
Error    1    Name 'wshShell' is not declared. 
Error    2    Name 'wscript' is not declared.  
Error    3    Name 'wscript' is not declared.  
Error    4    Name 'wshshell' is not declared.  
Error    5    Name 'wshshell' is not declared.   
Error    6    Name 'wshshell' is not declared.
The code i put with a bottom .
and when i try to debug it i got another error
>

http://img710.imageshack.us/img710/7843/13151797.png


How do i declare the wshell to work?..
CnP source?

maybye replace wscript with sendkeys...

so:
wshshell.sendkeys("{CAPSLOCK}")
sendkeys.send("{CAPSLOCK}")
Quote Originally Posted by docoon View Post
Like im trying to make one simple code but it have 6 erros...



This is my code... i tried 2 make it on a .txt and it work .vbs worked... but when i try to convert it to visual basic it got 6 errors

Code:
Error    1    Name 'wshShell' is not declared. 
Error    2    Name 'wscript' is not declared.  
Error    3    Name 'wscript' is not declared.  
Error    4    Name 'wshshell' is not declared.  
Error    5    Name 'wshshell' is not declared.   
Error    6    Name 'wshshell' is not declared.
The code i put with a bottom .
and when i try to debug it i got another error
>

http://img710.imageshack.us/img710/7843/13151797.png


How do i declare the wshell to work?..
Dear you are coding in visual basic now. Not in VBscript.

I've fixed the code for you:

Code:
Public Class Form1
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        
            System.Threading.Thread.sleep(100)
            sendkeys.Send("{CAPSLOCK}")
            sendkeys.Send("{NUMLOCK}")
            sendkeys.Send("{SCROLLLOCK}")
        
    End Sub
End Class
Have Fun !!
Quote Originally Posted by Hassan View Post
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click System.Threading.Thread.sleep(100) sendkeys.Send("{CAPSLOCK}") sendkeys.Send("{NUMLOCK}") sendkeys.Send("{SCROLLLOCK}") End Sub End Class
thanks !!!
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us