SendKeys.Send("^A")

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ucasesoftware

    #1

    SendKeys.Send("^A")

    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 ! ?

  • Herfried K. Wagner [MVP]

    #2
    Re: SendKeys.Send(& quot;^A")

    "ucasesoftw are" <ucasesoftware@ hotmail.fr> schrieb:[color=blue]
    > All SendKeys.Send like ^C, ^V, ^X work in my form with textboxes but
    > SendKeys.Send(" ^A") doesn't work ! ??[/color]

    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.ActiveContro l Is TextBox Then
    Dim txt As TextBox = DirectCast(Me.A ctiveControl, TextBox)
    txt.SelectAll()
    End If
    ///

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: SendKeys.Send(& quot;^A&quot;)

      "ucasesoftw are" <ucasesoftware@ hotmail.fr> schrieb:[color=blue]
      > All SendKeys.Send like ^C, ^V, ^X work in my form with textboxes but
      > SendKeys.Send(" ^A") doesn't work ! ??[/color]

      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.ActiveContro l Is TextBox Then
      Dim txt As TextBox = DirectCast(Me.A ctiveControl, TextBox)
      txt.SelectAll()
      End If
      ///

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      • ucasesoftware

        #4
        Re: SendKeys.Send(& quot;^A&quot;)

        I have a problem with your code cause i have a MDI application
        me.activateCont rol is the child :( and not the textbox in the child
        form

        Comment

        • ucasesoftware

          #5
          Re: SendKeys.Send(& quot;^A&quot;)

          I have a problem with your code cause i have a MDI application
          me.activateCont rol is the child :( and not the textbox in the child
          form

          Comment

          • ucasesoftware

            #6
            Re: SendKeys.Send(& quot;^A&quot;)

            Here is the solution for mdi Child
            If TypeOf Me.ActiveMdiChi ld.ActiveContro l Is TextBox Then
            Dim txt As TextBox =
            DirectCast(Me.A ctiveMdiChild.A ctiveControl, TextBox)
            txt.SelectAll()
            End If

            Thx a lot again

            Comment

            • ucasesoftware

              #7
              Re: SendKeys.Send(& quot;^A&quot;)

              Here is the solution for mdi Child
              If TypeOf Me.ActiveMdiChi ld.ActiveContro l Is TextBox Then
              Dim txt As TextBox =
              DirectCast(Me.A ctiveMdiChild.A ctiveControl, TextBox)
              txt.SelectAll()
              End If

              Thx a lot again

              Comment

              Working...