// topmostdg.cs using System; using System.Data; using System.Windows.Forms; public class TopMostDataGridForm : Form { DataGrid dataGrid1; public TopMostDataGridForm () { this.dataGrid1 = new DataGrid(); this.dataGrid1.Dock = DockStyle.Fill; this.dataGrid1.Paint += new PaintEventHandler(this.dataGrid1_Paint); this.Controls.Add(dataGrid1); this.TopMost = true; this.Text = "最前面表示DataGrid"; this.Load += new EventHandler(this.Form_Load); } static void Main() { Application.Run(new TopMostDataGridForm()); } void Form_Load(object sender, EventArgs e) { // Insider.NETのRSS情報をDataGridに表示 DataSet ds = new DataSet(); ds.ReadXml("http://www.atmarkit.co.jp/rss/fdotnet/rss2dc.xml"); this.dataGrid1.DataSource = ds.Tables["item"]; } void dataGrid1_Paint(object sender, PaintEventArgs e) { this.TopMost = true; } } // コンパイル方法:csc topmostdg.cs