public Form1() { InitializeComponent(); Width = 580; Height = 600; Button usePrevious = new Button() { Location = new Point(360, 25), Size = new Size(200, 30), Text = "Використати останню конфігурацію" }; usePrevious.Click += (s, e) => { CrossWord crossWord = new CrossWord(); crossWord.FormClosed += (senser, evArgs) => { Close(); }; crossWord.Show(); Hide(); }; Controls.Add(usePrevious); Text = "Генератор кросвордів"; _amount = 0; _configPath = ConfigurationManager.AppSettings["configuration"]; CreateStartControls(); }
private void GoToWordCreating() { Controls.Clear(); Width = 665; Height = 600; Label nameLabel = new Label() { Location = new Point(10, 10), Size = new Size(100, 20), Text = "Слово:" }; Label definitionLabel = new Label() { Location = new Point(120, 10), Size = new Size(100, 20), Text = "Визначення:" }; for (int i = 0; i < _amount; i++) { TextBox wordName = new TextBox() { Location = new Point(10, 30 + i * 50), Width = 100, MaxLength = lengths[i] }; RichTextBox wordDefinition = new RichTextBox() { Location = new Point(120, 30 + i * 50), Width = 200, Height = 40 }; Controls.Add(nameLabel); Controls.Add(wordName); Controls.Add(definitionLabel); Controls.Add(wordDefinition); } Button createCrossword = new Button() { Location = new Point(325, 30), Text = "Створити" }; createCrossword.Click += (s, e) => { AddWords(); CrossWord crossWord = new CrossWord(); crossWord.FormClosed += (senser, evArgs) => { Close(); }; crossWord.Show(); Hide(); }; Controls.Add(createCrossword); }