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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:39:00+00:00 2026-06-11T08:39:00+00:00

So I’m trying to teach myself object oriented programming using VB.net, and Although I

  • 0

So I’m trying to teach myself object oriented programming using VB.net, and Although I have some basic experience with it, I feel that I’m doing something terribly wrong.

There are two visible screens (Forms) to my application, a “select your difficulty” screen that I’ll refer to as screen1, and a “game” screen that I will refer to as screen2.

  1. I create a Main() class that runs when the application has loaded

  2. From within Main() I generate screen1 and screen2 (both Forms).

  3. Screen1 holds two buttons. When clicked, they will hide the current screen, display screen2, and begin the game with a set difficulty based on what button was chosen.

After jumping into the Form class, I can no longer reference Main(), where I would be able to close one form and open another with ease.

So the question is this. With regards to correct object oriented design. What is the most widely accepted way to change screens and start the game running?

I don’t require code snippets or anything, I just need a basic explanation of how things should be done.

  • 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-11T08:39:02+00:00Added an answer on June 11, 2026 at 8:39 am

    When you show the form from within your Main entry point method, you must be calling Application.Run. When you do so, execution does not continue to the next line in the Main method until the form is closed. So for instance, you could show the second form right after the first one is closed like this:

    Sub Main()
        Application.Run(New Screen1())
        Application.Run(New Screen2())
    End Sub
    

    However, that’s not typically how something like that is done. Typically, you would only call Application.Run once, on the first one, and then that form shows the second one. However, if you do that, you have to make sure the first form doesn’t close until you want the program to end. So, rather than closing screen1, it should just hide itself. For instance:

    Class Screen1
        Private Sub ShowScreen2()
            Dim screen2 As New Screen2()
            Me.Hide()
            screen2.Show()
        End Sub
    End Class
    

    Then, Screen1 could have an event handler to watch for when Screen2 closes and either re-show itself or close itself at that point. Or, if appropriate, you could show Screen2 as a dialog window which means execution won’t continue in that method until the second screen is closed, for instance:

    Class Screen1
        Private Sub ShowScreen2()
            Dim screen2 As New Screen2()
            Me.Hide()
            screen2.ShowDialog()
            Me.Show()
        End Sub
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.