Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

Send keys

$
0
0
Hello!

Code:

text = TextBox1.Text
SendKeys.Send(text)
SendKeys.Send("{enter}")

Problem: It works fine, but when symbols like '%' '/' ... are written into textbox1, it gives an error

I tried this:

Code:

For Each asd As Char In TextBox1.Text
              If asd = "/" Then
                  SendKeys.Send(Chr(41))
              Else
                  SendKeys.Send(asd)
              End If

Next
SendKeys.Send("{enter}")

So I should write if statement for each symbol that isn't working with sendkeys.send...
and if I miss some (I cant write them all on that way) the app will crash

Is there any better way to accomplish what I want?
So that all symbols can get send...

thx

Viewing all articles
Browse latest Browse all 42215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>