Windows XPのスタイルを適用するのは、Ver1.0では結構面倒でした。
マニフェストファイルを作ってそれを利用する、という手順が必要でしたから。
詳しくは
こちらで確認してください。
Ver1.1でこれが簡単にできるようになりました。
各コントロールにFlatStyleの設定をして、Application.EnableVisualStyles()を呼び出すだけ。
以下のサンプルでボタンの形状がXPスタイルで表示されることが確認できます。
-------------------------------------------------------
using System;
using System.Windows.Forms;
class WinSample : Form
{
private Button mybutton;
public static void Main()
{
// XPスタイルの設定 Ver1.1のみ有効
Application.EnableVisualStyles();
Application.Run(new WinSample());
}
public WinSample()
{
this.mybutton = new Button();
this.SuspendLayout();
this.Text = "Hello World!";
this.mybutton.Location = new System.Drawing.Point(200, 200);
this.mybutton.Text = "閉じる";
this.mybutton.Click += new EventHandler(this.mb_Click);
// FlatStyleを設定しておかないとXPスタイルにならない
this.mybutton.FlatStyle = FlatStyle.System;
this.Controls.Add(mybutton);
this.ResumeLayout(false);
}
private void mb_Click(object sender, EventArgs e)
{
this.Close();
}
}
-------------------------------------------------------
あおい情報システム株式会社 小野修司(どっとねっとふぁん)