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 8012957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:29:46+00:00 2026-06-04T19:29:46+00:00

I am doing support on a VB.Net application although I am primarily a C#

  • 0

I am doing support on a VB.Net application although I am primarily a C# developer. I have encountered what I consider to be “strange” code, in that my C# mindset tells me that the code is wrong and shouldn’t compile, yet it does. I did a Find all references on a particular form to see where it was being used and found references to the form where non-shred methods of the class were being directly referenced without the class being instantiated. In other words, I see code like this:

FrmCareer.ShowDialog(careerId)
FrmCareer = Nothing

Now ShowDialog is not a shared member, and it references instance member variables, so I would not expect intellisense to list the ShowDialog method at all. But it does and it compiles. Can anyone explain what is going on here?

  • 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-04T19:29:47+00:00Added an answer on June 4, 2026 at 7:29 pm

    VB.NET has the (very nice) feature of keeping a collection of all forms as properties under the My.Forms object. The objects there are instantiated when you first access them. In this way, you get a default instance of each form that you can refer to.

    On the not so nice side, VB insists on importing the My.Forms object’s properties globally, and there’s nothing you can do to change that.

    In other words, the class name of any form in your application doubles as a global instance of that form.

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

Sidebar

Related Questions

I have taken over support of a VB .Net application that makes use of
I'm designing an ASP.NET application that must support 'SubSites'. The idea is to have
We have an ASP.NET application that uses the Infragistics WebSchedule control to display appointments
I'm fighting with a strange behavior here... Doing an asp.net mvc3 application with NHibernate
Assume I have an ASP.NET MVC app that's not doing anything too fancy (no
I am taken over support on a VB.Net WinForms application and the company that
I have taken over support of a VB.Net WinForms application. I am actually a
I am doing stress tests on my ASP.Net MVC2 application, and I have set
We have an existing certificate issuing application (C#, ASP.NET, JavaScript) that issues certificates to
I am doing some multi-touch support that allow 2 fingers to rotate a photos.

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.