HowTo Textbox.Focus with a Panel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?anAybXNmdA==?=

    HowTo Textbox.Focus with a Panel

    I have several applications that use panels as screens for different parts of
    our application.

    Panel1.BringToF ront()
    Panel1_Textbox. Focus()
    ' do something with a control on Panel1
    Panel2.BringToF ront()
    Panel2_Textbox. Focus()
    ' do something with a control on Panel2

    When the applications are running, I can see the Textbox controls receiving
    focus for an instant, then Nothing has focus!

    How do I set the Focus on the Textbox controls ... and have it STAY there?
  • PvdG42

    #2
    Re: HowTo Textbox.Focus with a Panel

    "jp2msft" <jp2msft@discus sions.microsoft .comwrote in message
    news:43F82419-5939-49BF-ACFA-2F5C95217B82@mi crosoft.com...
    >I have several applications that use panels as screens for different parts
    >of
    our application.
    >
    Panel1.BringToF ront()
    Panel1_Textbox. Focus()
    ' do something with a control on Panel1
    Panel2.BringToF ront()
    Panel2_Textbox. Focus()
    ' do something with a control on Panel2
    >
    When the applications are running, I can see the Textbox controls
    receiving
    focus for an instant, then Nothing has focus!
    >
    How do I set the Focus on the Textbox controls ... and have it STAY there?

    Where is this code, in what procedure?

    Comment

    • =?Utf-8?B?anAybXNmdA==?=

      #3
      Re: HowTo Textbox.Focus with a Panel

      It is scattered throughout my code.

      It is placed in the Form_Load() first, but that does not work.

      If they click the Login button, the Login_Clicked event has
      Login_Panel.Bri ngToFront() and Login_Textbox.F ocus(), but the Textbox never
      receives focus.

      After the successfully log in, I call Partnumber_Pane l.BringToFront( ) and
      Partnumber_Text box.Focus(), but the Textbox there never receives focus either.

      This happens in other applications, too. Not just this one instance. So, I
      presume I am doing something incorrect.

      Any thoughts?

      "PvdG42" wrote:
      >
      Where is this code, in what procedure?
      >
      >

      Comment

      • =?Utf-8?B?anAybXNmdA==?=

        #4
        RE: HowTo Textbox.Focus with a Panel

        Nobody knows how to do this, I take.

        Either that, or people on this group just don't understand my question.

        "jp2msft" wrote:
        I have several applications that use panels as screens for different parts of
        our application.
        >
        Panel1.BringToF ront()
        Panel1_Textbox. Focus()
        ' do something with a control on Panel1
        Panel2.BringToF ront()
        Panel2_Textbox. Focus()
        ' do something with a control on Panel2
        >
        When the applications are running, I can see the Textbox controls receiving
        focus for an instant, then Nothing has focus!
        >
        How do I set the Focus on the Textbox controls ... and have it STAY there?

        Comment

        • PvdG42

          #5
          Re: HowTo Textbox.Focus with a Panel

          "jp2msft" <jp2msft@discus sions.microsoft .comwrote in message
          news:34A92464-50F1-4651-9548-B86857961131@mi crosoft.com...
          Nobody knows how to do this, I take.
          >
          Either that, or people on this group just don't understand my question.
          >
          To clarify my previous. The MouseEnter event for the panel.

          Comment

          • =?Utf-8?B?anAybXNmdA==?=

            #6
            Re: HowTo Textbox.Focus with a Panel

            MouseEnter event for the panel. Understood. I'll give that a go on Monday
            (long weekend). Thanks!

            "PvdG42" wrote:
            "jp2msft" <jp2msft@discus sions.microsoft .comwrote in message
            news:34A92464-50F1-4651-9548-B86857961131@mi crosoft.com...
            Nobody knows how to do this, I take.

            Either that, or people on this group just don't understand my question.
            To clarify my previous. The MouseEnter event for the panel.
            >
            >

            Comment

            Working...