using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication3 { public partial class Form1 : Form { public Form1() { InitializeComponent(); LoadVocabulary(); Generate(); } public class VocabularyWord { public string Word; public string Definition; public int Number; } public void LoadVocabulary() { int wordcount = 0; VocabularyWord Ensconced = new VocabularyWord(); Ensconced.Word = "Ensconced"; Ensconced.Definition = "establish or settle in a comfortable, safe, or secret place."; Ensconced.Number = 1; wordcount = wordcount + 1; VocabularyWord Comrades = new VocabularyWord(); Comrades.Word = "Comrades"; Comrades.Definition = "a companion who shares one's activities or is a fellow member of an organization."; Comrades.Number = 2; wordcount = wordcount + 1; } public void Generate() { Random Randomize = new Random(); int RandomNumber = Randomize.Next(1, 2); if (RandomNumber == 1) { label1.Text = Ensconced.Word; } else { label1.Text = Comrades.Word; } } } //I think it may be because I'm using 'public' wrong? I have no idea. Please help.
Last edited: