// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using System.Drawing; using System.Windows.Forms; using Order.Backend; namespace Order.Frontend { public class ViewSalesStatsForm : Form { private DataGridView stats; public ViewSalesStatsForm() { Persister p = new Persister(); SuspendLayout(); ClientSize = new Size(400, 400); Text = "View Sales Statistics"; stats = new DataGridView(); stats.DataSource = p.GetSalesStats(); stats.Size = new Size(300, 300); stats.Location = new Point(50, 50); stats.ReadOnly = true; stats.ScrollBars = ScrollBars.None; stats.RowHeadersVisible = false; Controls.Add(stats); ResumeLayout(false); } } }