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

  • Home
  • SEARCH
  • 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 3352684
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:03:36+00:00 2026-05-18T02:03:36+00:00

I am currently translating a windows form application, written in VB6, to a webpage

  • 0

I am currently translating a windows form application, written in VB6, to a webpage written in Visual Studio 2010.

In VB6 it is easy to find out which control has focus on the form using ‘.getFocus()’. I have come to the conclusion it is not that easy, if at all possible, in vb2008.

Is this possible to do?

  • 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-05-18T02:03:36+00:00Added an answer on May 18, 2026 at 2:03 am

    In WinForms you can create a foreach loop like this and check if a specific control has focus:

    foreach (Control item in this.Controls)
    {
     if (item.Focused)
      //codes to handle the condition
    }  
    

    Or like spacemonkeyes said, use this.ActiveControl or VB’s version Me.ActiveControl

    However for a webpage I think you have to use JavaScript. The document object has a property named ActiveElement which as far as I know, only IE supports this property:
    document.ActiveElement
    It returns a reference to the focused control.
    To use it on the server side, you have to have a form which is submitted to the server or you could use Ajax to submit that particular control. Pretty complex codings are required.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently translating an API from C# to Java which has a network component.
Does anyone have experience of rapidly translating an access application into a standalone windows
Currently I'm doing some unit tests which are executed from bash. Unit tests are
I'm writing an application that is currently a pure QT4 app. It is designed
I have a pawnshop CRUD app written 20 years ago with INFORMIX-SQL/SE (DOS) which
I'm making a game which you can see here, if you are on Windows
Currently I am using ckEditor with ckFinder in Symfony. When I save a form
Currently, I don't really have a good method of debugging JavaScript in Internet Explorer and
Currently my workflow with Emacs when I am coding in C or C++ involves
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.

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.