SendKeys.Send("^A")

  • Thread starter Thread starter ucasesoftware
  • Start date Start date
U

ucasesoftware

All SendKeys.Send like ^C, ^V, ^X work in my form with textboxes but
SendKeys.Send("^A") doesn't work ! ??

i have a bip error windows ! ?
 
ucasesoftware said:
All SendKeys.Send like ^C, ^V, ^X work in my form with textboxes but
SendKeys.Send("^A") doesn't work ! ??

The textbox control doesn't support selecting the whole text using a
keyboard shortcut. You may want to use the code below instead:

\\\
If TypeOf Me.ActiveControl Is TextBox Then
Dim txt As TextBox = DirectCast(Me.ActiveControl, TextBox)
txt.SelectAll()
End If
///
 
I have a problem with your code cause i have a MDI application
me.activateControl is the child :( and not the textbox in the child
form
 
Here is the solution for mdi Child
If TypeOf Me.ActiveMdiChild.ActiveControl Is TextBox Then
Dim txt As TextBox =
DirectCast(Me.ActiveMdiChild.ActiveControl, TextBox)
txt.SelectAll()
End If

Thx a lot again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top