p-GeoGame / CSharp_GeographyGame / FormProivder.cs
FormProivder.cs
Raw
// Tutorial based on: https://stackoverflow.com/questions/3005732/showing-a-hidden-form
// And: https://stackoverflow.com/questions/5646954/how-to-access-winform-textbox-control-from-another-class
// Allows the ability to grab the text entered from user to be accessed by a class

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharp_GeographyGame
{
    public class FormProvider
    {
        public static string userName;

        public static gamemenuForm gForm
        {
            get
            {
                if (gameForm == null)
                {
                    gameForm = new gamemenuForm(userName);
                }
                return gameForm;
            }
        }
        private static gamemenuForm gameForm;
    }
}