Quantcast
Channel: C#タグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 9326

cscの作法 その2

$
0
0

概要

cscの作法、調べてみた。
イベントやってみた。

写真

image.png

サンプルコード

using System;
using System.Windows.Forms;
using System.Drawing;

class form1: Form {
    form1() {
        Text = "hello";
        ClientSize = new Size(200, 200);
        Button btn1 = new Button();
        btn1.Location = new Point(50, 50);
        btn1.Text = "test";
        btn1.Click += btn1_Click;
        Controls.AddRange(new Control[] {
            btn1
        });
    }
    void btn1_Click(object sender, System.EventArgs e) {
        MessageBox.Show("Hello World", "こんちは");
    }
    [STAThread]
    public static void Main() {
        Application.Run(new form1());
    }
}

以上。


Viewing all articles
Browse latest Browse all 9326

Latest Images

Trending Articles