Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- class MyButtonClass : Form
- {
- private Button mrButton;
- // Метод-конструктор
- public MyButtonClass()
- {
- mrButton = new Button();
- mrButton.Text = “Нажми меня”;
- mrButton.Click += new System.EventHandler(MyButtonClickEventHandler);
- this.Controls.Add(mrButton);
- }
- // Основной метод
- static void Main()
- {
- Application.Run(new MyButtonClass());
- }
- // Метод-обработчик событий
- void MyButtonClickEventHandler(object sender, EventArgs e)
- {
- mrButton.Text = “Вы нажали меня!”;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement