「.NET/FormTest2」の編集履歴(バックアップ)一覧はこちら
「.NET/FormTest2」(2014/08/12 (火) 14:30:43) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
|開発環境|メモ帳|
|実行環境|Windows 7 Home Premium (32bit)|
#table_zebra(project, #fff, #eee)
参考
-[[GUI アプリケーション (C# によるプログラミング入門)>http://ufcpp.net/study/csharp/lib_forms.html]]
FormTest2.cs
#highlight(c#){{
// FormTest2.cs
using System;
using System.Drawing;
using System.Windows.Forms;
public class Form1 : Form
{
private Button button1;
private int count = 0;
public Form1()
{
Width = 200;
Height = 80;
Text = "FormTest2";
button1 = new Button();
button1.Location = new Point(10, 10);
button1.Size = new Size(170, 30);
button1.Text = "Push here.";
button1.Click += new EventHandler(button1_Click);
Controls.Add(button1);
}
private void button1_Click(object sender, EventArgs e)
{
count++;
button1.Text = count.ToString();
}
}
static class Program
{
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}}
コンパイル手順
#highlight(txt){{
D:\tmp>csc
'csc' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
D:\tmp>path %path%;C:\Windows\Microsoft.NET\Framework\v4.0.30319
D:\tmp>csc FormTest2.cs
Microsoft (R) Visual C# Compiler Version 4.0.30319.18408
for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.
}}
|開発環境|メモ帳|
|実行環境|Windows 7 Home Premium (32bit)|
#table_zebra(project, #fff, #eee)
参考
-[[GUI アプリケーション (C# によるプログラミング入門)>http://ufcpp.net/study/csharp/lib_forms.html]]
FormTest2.cs
#highlight(c#){{
// FormTest2.cs
using System;
using System.Drawing;
using System.Windows.Forms;
public class Form1 : Form
{
private Button button1;
private int count = 0;
public Form1()
{
Width = 200;
Height = 80;
Text = "FormTest2";
button1 = new Button();
button1.Location = new Point(10, 10);
button1.Size = new Size(170, 30);
button1.Text = "Push here.";
button1.Click += new EventHandler(button1_Click);
Controls.Add(button1);
}
private void button1_Click(object sender, EventArgs e)
{
count++;
button1.Text = count.ToString();
}
}
static class Program
{
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}}
コンパイル手順
#highlight(txt){{
D:\tmp>csc
'csc' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
D:\tmp>path %path%;C:\Windows\Microsoft.NET\Framework\v4.0.30319
D:\tmp>csc /t:winexe FormTest2.cs
Microsoft (R) Visual C# Compiler Version 4.0.30319.18408
for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.
}}