Вызов функции из функции в виде функция1(функция2) - C#
Формулировка задачи:
Всем привет, название говорит само за себя.
FunctionEnabler(somefunction);
Решение задачи: «Вызов функции из функции в виде функция1(функция2)»
textual
Листинг программы
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CheckBoxS
{
public partial class Form1 : Form
{
[STAThread]
static void Main()
{ Application.Run(new Form1()); }
private TextBox textBox1;
private Label label1;
string[] Predmet = new[] { "Математика", "Физика", "Химия", "Литература", "Русский Язык" };
CheckBox[] checkS = new CheckBox[5];
public Form1()
{
InitializeComponent();
label1.Text = "Сегодня, " + DateTime.Now.ToShortDateString() + " будут занятия:";
for (int i = 0; i < Predmet.Length; i++)
{
checkS[i] = new CheckBox();
checkS[i].Location = new Point(21, 24*(i+1));
checkS[i].Text = Predmet[i];
checkS[i].CheckedChanged += new System.EventHandler(this.checkBox_CheckedChanged);
this.Controls.Add(checkS[i]);
}
}
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(322, 33);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(199, 228);
this.textBox1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(330, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 1;
this.label1.Text = "label1";
//
// Form1
//
this.ClientSize = new System.Drawing.Size(542, 273);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.ResumeLayout(false);
this.PerformLayout();
}
private void checkBox_CheckedChanged(object sender, EventArgs e)
{
textBox1.Text = "";
for (int i = 0; i < checkS.Length; i++)
{
if (checkS[i].Checked) textBox1.Text += checkS[i].Text + "\r\n";
}
}
}
}