G
Guest
I have a procedure that needs to put characters into the current insertion
point of a textbox. This insertion point is not necessarily the end of the
current string so textbox1.text &= "?" won't do.
I have found that using sendkeys does the trick:
Private Sub UserControl11_buttonpress(ByVal text As String) Handles
UserControl11.buttonpress
System.Windows.Forms.SendKeys.Send(text)
End Sub
However if the parameter "text" happens to be "(" or ")", I get the
following error:
An unhandled exception of type 'System.ArgumentException' occurred in
system.windows.forms.dll
Additional information: Group are delimiters not balanced.
It looks like sendkeys is evaluating (text) rather that simply mimicking a
"(" key press.
There does not appear to be a special sendkeys code for parenthesis and
chr(40 or 41) doesn't work.
How do I handle this special case?
point of a textbox. This insertion point is not necessarily the end of the
current string so textbox1.text &= "?" won't do.
I have found that using sendkeys does the trick:
Private Sub UserControl11_buttonpress(ByVal text As String) Handles
UserControl11.buttonpress
System.Windows.Forms.SendKeys.Send(text)
End Sub
However if the parameter "text" happens to be "(" or ")", I get the
following error:
An unhandled exception of type 'System.ArgumentException' occurred in
system.windows.forms.dll
Additional information: Group are delimiters not balanced.
It looks like sendkeys is evaluating (text) rather that simply mimicking a
"(" key press.
There does not appear to be a special sendkeys code for parenthesis and
chr(40 or 41) doesn't work.
How do I handle this special case?