Методы должны содержать тип возвращаемого значения. Ошибка - C#
Формулировка задачи:
Кто-нибудь сталкивался с подобной ошибкой? Что сделано неверно? Будьте любезны,помогите
Program.cs(8,8,8,18): error CS1520: Методы должны содержать тип возвращаемого значения
Листинг программы
- using System;
- using System.Windows.Forms;
- using System.Drawing;
- class Menu : Form
- {
- Button mrButtonCorrect,mrButtonRest,mrButtonClose;
- // Метод-конструктор нашего класса
- public Correction(){
- this.Text = "ENGLISH";
- this.Controls.Add(mrButtonCorrect);}
- public Menu()
- {
- // Указываем заголовок окна
- this.Text = "myMarks";
- // Добавляем кнопку и привязываем ее к обработчику события
- mrButtonCorrect = new Button();
- mrButtonCorrect.Text = "Исправление оценок";
- mrButtonCorrect.Top = 50;
- mrButtonCorrect.Left = 25;
- mrButtonCorrect.Height = 50;
- mrButtonCorrect.Width = 150;
- mrButtonCorrect.Click += new System.EventHandler(mrButton_Click);
- mrButtonRest = new Button();
- mrButtonRest.Top = 120;
- mrButtonRest.Left = 25;
- mrButtonRest.Height = 50;
- mrButtonRest.Width = 150;
- mrButtonRest.Text = "Безделье";
- mrButtonClose = new Button();
- mrButtonClose.Top = 190;
- mrButtonClose.Left = 25;
- mrButtonClose.Height = 50;
- mrButtonClose.Width = 150;
- mrButtonClose.Text = "Закрыть";
- this.Controls.Add(mrButtonCorrect);
- this.Controls.Add(mrButtonRest);
- this.Controls.Add(mrButtonClose);
- this.Height = 400;
- this.Width = 400;
- }
- static void Main()
- {
- // Создаем и запускаем форму
- Application.Run(new Menu());//ТУТА ДЕЛАТЬ НАДА
- }
- // Обработчик события, срабатывающий при нажатии кнопки
- void mrButton_Click(object sender, EventArgs e)
- {
- Application.Run(new Correction());
- }
- private void InitializeComponent()
- {
- this.SuspendLayout();
- //
- // Menu
- //
- this.ClientSize = new System.Drawing.Size(483, 343);
- this.Name = "Menu";
- this.ResumeLayout(false);
- }
- }
Решение задачи: «Методы должны содержать тип возвращаемого значения. Ошибка»
textual
Листинг программы
- public void Correction() {
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д