本文整理汇总了C#中System.Windows.Forms.DataGridView.Font属性的典型用法代码示例。如果您正苦于以下问题:C# DataGridView.Font属性的具体用法?C# DataGridView.Font怎么用?C# DataGridView.Font使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Windows.Forms.DataGridView
的用法示例。
在下文中一共展示了DataGridView.Font属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupDataGridView
private void SetupDataGridView()
{
this.Controls.Add(songsDataGridView);
songsDataGridView.ColumnCount = 5;
songsDataGridView.ColumnHeadersDefaultCellStyle.BackColor = Color.Navy;
songsDataGridView.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
songsDataGridView.ColumnHeadersDefaultCellStyle.Font =
new Font(songsDataGridView.Font, FontStyle.Bold);
songsDataGridView.Name = "songsDataGridView";
songsDataGridView.Location = new Point(8, 8);
songsDataGridView.Size = new Size(500, 250);
songsDataGridView.AutoSizeRowsMode =
DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders;
songsDataGridView.ColumnHeadersBorderStyle =
DataGridViewHeaderBorderStyle.Single;
songsDataGridView.CellBorderStyle = DataGridViewCellBorderStyle.Single;
songsDataGridView.GridColor = Color.Black;
songsDataGridView.RowHeadersVisible = false;
songsDataGridView.Columns[0].Name = "Release Date";
songsDataGridView.Columns[1].Name = "Track";
songsDataGridView.Columns[2].Name = "Title";
songsDataGridView.Columns[3].Name = "Artist";
songsDataGridView.Columns[4].Name = "Album";
songsDataGridView.Columns[4].DefaultCellStyle.Font =
new Font(songsDataGridView.DefaultCellStyle.Font, FontStyle.Italic);
songsDataGridView.SelectionMode =
DataGridViewSelectionMode.FullRowSelect;
songsDataGridView.MultiSelect = false;
songsDataGridView.Dock = DockStyle.Fill;
songsDataGridView.CellFormatting += new
DataGridViewCellFormattingEventHandler(
songsDataGridView_CellFormatting);
}