Exemple #1
0
        private void NextButton_Click(object sender, EventArgs e)
        {
            Character character = Program.character;

            character.Strength     = StrengthTextBox.Text;
            character.Dexterity    = DexterityTextBox.Text;
            character.Constitution = ConstitutionTextBox.Text;
            character.Intelligence = IntelligenceTextBox.Text;
            character.Wisdom       = WisdomTextBox.Text;
            character.Charisma     = CharismaTextBox.Text;

            // Step 1 - Hide the parent form
            this.Hide();

            // Step 2 - Instantiate an object for the form type
            // you are going to next
            RaceAndClassForm raceAndClassForm = new RaceAndClassForm
            {
                // Step 3 - create a property in the next form that
                // we will use to point to this form
                // e.g. public AbilityGeneratorForm previousForm;

                // Step 4 - point this form to the parent Form
                // property in the next form
                previousForm = this
            };

            // Step 5 - Show the next form
            raceAndClassForm.Show();
        }
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     splash  = new splashform();
     genform = new GenerateNameForm();
     ability = new AbilityGeneratorForm();
     race    = new RaceAndClassForm();
     final   = new FinalForm();
     Application.Run(new splashform());
 }
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //  INSTANTIATING THE FORM OBJECTS
            splashform           = new SplashForm();
            abilitygeneratorform = new AbilityGeneratorForm();
            aboutbox             = new AboutBox();
            finalform            = new FinalForm();
            generatenameform     = new GenerateNameForm();
            raceandclassform     = new RaceAndClassForm();

            //  DECLARING WHICH FORM WILL APPEAR FIRST
            Application.Run(splashform);
        }
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //  this will instaniate the form object
            splashform           = new SplashForm();
            abilitygeneratorform = new AbilityGeneratorForm();
            aboutbox             = new AboutBox();
            finalform            = new FinalForm();
            generatenameform     = new GenerateNameForm();
            raceandclassform     = new RaceAndClassForm();

            //  this will help to declare the splash form first
            Application.Run(splashform);
        }