Problem with ToolStripTextBox

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

    Problem with ToolStripTextBox

    I just want to select the complete text when someone enters the textbox
    (mouse click etc.). When I am executing within the IDE (VS 2005 Pro) no
    problem.

    Execute outside the IDE and no select takes place.


    Code:

    Private Sub tbSearchTxt_Ent er(ByVal sender As System.Object, ByVal e As
    System.EventArg s) Handles tbSearchTxt.Ent er
    ' select all text to make paste of new info easier
    tbSearchTxt.Sel ectAll()
    End Sub

    Any ideas or is that control broken?

    Lloyd Sheen

  • Lloyd Sheen

    #2
    Re: Problem with ToolStripTextBo x


    "Lloyd Sheen" <a@b.cwrote in message
    news:eiTNXKXKIH A.3916@TK2MSFTN GP02.phx.gbl...
    >I just want to select the complete text when someone enters the textbox
    >(mouse click etc.). When I am executing within the IDE (VS 2005 Pro) no
    >problem.
    >
    Execute outside the IDE and no select takes place.
    >
    >
    Code:
    >
    Private Sub tbSearchTxt_Ent er(ByVal sender As System.Object, ByVal e As
    System.EventArg s) Handles tbSearchTxt.Ent er
    ' select all text to make paste of new info easier
    tbSearchTxt.Sel ectAll()
    End Sub
    >
    Any ideas or is that control broken?
    >
    Lloyd Sheen
    More info. It seems the only reason it worked in IDE is the breakpoint. No
    breakpoint no code execution it seems. Now I put a msgbox in the handler
    code and it works both in IDE and as executable outside the IDE. Some
    pretty weird stuff going on here.

    LS

    Comment

    • =?Utf-8?B?VGVycnk=?=

      #3
      Re: Problem with ToolStripTextBo x

      It is not just the ToolStripTextBo x, all text boxes work this way. Why not
      just put your selectall in the click event?
      --
      Terry


      "Lloyd Sheen" wrote:
      >
      "Lloyd Sheen" <a@b.cwrote in message
      news:eiTNXKXKIH A.3916@TK2MSFTN GP02.phx.gbl...
      I just want to select the complete text when someone enters the textbox
      (mouse click etc.). When I am executing within the IDE (VS 2005 Pro) no
      problem.

      Execute outside the IDE and no select takes place.


      Code:

      Private Sub tbSearchTxt_Ent er(ByVal sender As System.Object, ByVal e As
      System.EventArg s) Handles tbSearchTxt.Ent er
      ' select all text to make paste of new info easier
      tbSearchTxt.Sel ectAll()
      End Sub

      Any ideas or is that control broken?

      Lloyd Sheen
      >
      More info. It seems the only reason it worked in IDE is the breakpoint. No
      breakpoint no code execution it seems. Now I put a msgbox in the handler
      code and it works both in IDE and as executable outside the IDE. Some
      pretty weird stuff going on here.
      >
      LS
      >
      >

      Comment

      • Lloyd Sheen

        #4
        Re: Problem with ToolStripTextBo x


        "Terry" <TerryL@nospam. nospamwrote in message
        news:6958CD2A-3BFE-4EB2-A028-CA0140A31311@mi crosoft.com...
        It is not just the ToolStripTextBo x, all text boxes work this way. Why
        not
        just put your selectall in the click event?
        --
        Terry
        >
        >
        "Lloyd Sheen" wrote:
        >
        >>
        >"Lloyd Sheen" <a@b.cwrote in message
        >news:eiTNXKXKI HA.3916@TK2MSFT NGP02.phx.gbl.. .
        >I just want to select the complete text when someone enters the textbox
        >(mouse click etc.). When I am executing within the IDE (VS 2005 Pro) no
        >problem.
        >
        Execute outside the IDE and no select takes place.
        >
        >
        Code:
        >
        Private Sub tbSearchTxt_Ent er(ByVal sender As System.Object, ByVal e As
        System.EventArg s) Handles tbSearchTxt.Ent er
        ' select all text to make paste of new info easier
        tbSearchTxt.Sel ectAll()
        End Sub
        >
        Any ideas or is that control broken?
        >
        Lloyd Sheen
        >>
        >More info. It seems the only reason it worked in IDE is the breakpoint.
        >No
        >breakpoint no code execution it seems. Now I put a msgbox in the handler
        >code and it works both in IDE and as executable outside the IDE. Some
        >pretty weird stuff going on here.
        >>
        >LS
        >>
        >>
        Thanks, did that and works like a charm. Wonder why clicking is not seen as
        entering..

        Oh well

        LS

        Comment

        • =?Utf-8?B?VGVycnk=?=

          #5
          Re: Problem with ToolStripTextBo x

          Here is my guess... clicking does the enter but then starts a new 'select'
          ending with the mouse up event. If you do other things like change the
          background and font colors in the 'enter' event, it works fine. So my guess
          is that the the text is getting selected in the enter and then deselected by
          the mouse events.
          --
          Terry


          "Lloyd Sheen" wrote:
          >
          "Terry" <TerryL@nospam. nospamwrote in message
          news:6958CD2A-3BFE-4EB2-A028-CA0140A31311@mi crosoft.com...
          It is not just the ToolStripTextBo x, all text boxes work this way. Why
          not
          just put your selectall in the click event?
          --
          Terry


          "Lloyd Sheen" wrote:
          >
          "Lloyd Sheen" <a@b.cwrote in message
          news:eiTNXKXKIH A.3916@TK2MSFTN GP02.phx.gbl...
          I just want to select the complete text when someone enters the textbox
          (mouse click etc.). When I am executing within the IDE (VS 2005 Pro) no
          problem.

          Execute outside the IDE and no select takes place.


          Code:

          Private Sub tbSearchTxt_Ent er(ByVal sender As System.Object, ByVal e As
          System.EventArg s) Handles tbSearchTxt.Ent er
          ' select all text to make paste of new info easier
          tbSearchTxt.Sel ectAll()
          End Sub

          Any ideas or is that control broken?

          Lloyd Sheen
          >
          More info. It seems the only reason it worked in IDE is the breakpoint.
          No
          breakpoint no code execution it seems. Now I put a msgbox in the handler
          code and it works both in IDE and as executable outside the IDE. Some
          pretty weird stuff going on here.
          >
          LS
          >
          >
          >
          Thanks, did that and works like a charm. Wonder why clicking is not seen as
          entering..
          >
          Oh well
          >
          LS
          >
          >

          Comment

          Working...