Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8257473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:12:31+00:00 2026-06-08T02:12:31+00:00

This is baffling me. I have a Windows Form with a TextBox, 2 RadioButtons,

  • 0

This is baffling me. I have a Windows Form with a TextBox, 2 RadioButtons, an OK Button & a Cancel Button. I was mucking around with Tabbing, but I have now removed it, so TextBox1 is set to TabIndex=1 & TabStop=True, all the other fields are set to TabIndex=0 & TabStop=False.

To get to this Form,I execute the following code :

    Private Sub ComboBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ChooseLeague.SelectedIndexChanged
    If ChooseLeague.SelectedIndex = 0 Then
        Me.Hide()
        MaintainDatabaseAddLeague.RadioButton1.Checked = False
        MaintainDatabaseAddLeague.RadioButton2.Checked = False
        MaintainDatabaseAddLeague.TextBox1.Text = ""
        MaintainDatabaseAddLeague.TextBox1.Focus()
        MaintainDatabaseAddLeague.Show()
    End If
End Sub

The Form opens and the cursor is blinking in the TextBox as required. However, if I cancel from the Form & then go back into it via the same method, the cursor is NOT in the TextBox and the Cancel Button is highlighted / has Focus.

Why is this, any ideas ?!?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:12:34+00:00Added an answer on June 8, 2026 at 2:12 am

    Since you are hiding and showing the form, it is showing the last focused control. The focus call doesn’t work until after the form is visible.

    Try switching it around and use the Select method.

    MaintainDatabaseAddLeague.Show()
    MaintainDatabaseAddLeague.TextBox1.Select()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is pretty basic question I am sure but it's baffling me now :S
This is strange and baffling. In my ASP.NET 2.0 app I have a form
I'm relatively new to C, and this is baffling me right now. It's part
So, starting with Android and Java, and I have this baffling error: The application
Ok so this problem is baffling me. I have a custom class that all
I have this simple form that is having some CSS issues when the field
Having another issue, and this one is BAFFLING! Here we go. We have a
So i feel like a noob but this has been baffling me or hours
for some reason I'm having trouble getting output with this form.. I have a
This is baffling me. It was working, now it's not. For some reason, my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.