本文整理汇总了C#中System.Windows.Forms.DataGridView.ResumeDrawing方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridView.ResumeDrawing方法的具体用法?C# DataGridView.ResumeDrawing怎么用?C# DataGridView.ResumeDrawing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataGridView
的用法示例。
在下文中一共展示了DataGridView.ResumeDrawing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setupPage
private void setupPage()
{
// Back out if the page has already been SetUp
if (currentDgv != null)
{
((DataGridView)mainTabControl.SelectedTab.Controls[0]).SelectionMode = DataGridViewSelectionMode.RowHeaderSelect;
return;
}
CtfEditorGamePage page;
// Setup Page
if (mainTabControl.SelectedIndex == (int)CtfEditorMainTabs.Formula1)
{
page = new CtfEditorGamePage(File.Open(System.Windows.Forms.Application.StartupPath + "\\ctfSchemaF12012.xml", FileMode.Open),
CtfEditorMainTabs.Formula1);
}
else if (mainTabControl.SelectedIndex == (int)CtfEditorMainTabs.Dirt)
{
page = new CtfEditorGamePage(File.Open(System.Windows.Forms.Application.StartupPath + "\\ctfSchemaDirt.xml", FileMode.Open),
CtfEditorMainTabs.Dirt);
}
else if (mainTabControl.SelectedIndex == (int)CtfEditorMainTabs.Other)
{
page = new CtfEditorGamePage(File.Open(System.Windows.Forms.Application.StartupPath + "\\ctfSchemaGrid2.xml", FileMode.Open),
CtfEditorMainTabs.Other);
}
else if (mainTabControl.SelectedIndex == (int)CtfEditorMainTabs.Grid)
{
page = new CtfEditorGamePage(File.Open(System.Windows.Forms.Application.StartupPath + "\\ctfSchemaGrid.xml", FileMode.Open),
CtfEditorMainTabs.Grid);
}
else
{
// SHOULD NOT HAPPEN, just doing it to satisfy compiler
return;
}
// Setup DGV
DataGridView dgv;
dgv = new DataGridView();
dgv.Dock = DockStyle.Fill;
//dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
//dgv.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells;
dgv.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders;
//dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
dgv.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
dgv.AllowUserToAddRows = false;
dgv.AllowUserToDeleteRows = false;
dgv.AlternatingRowsDefaultCellStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#E8EDFF");
dgv.TopLeftHeaderCell.Value = "ID";
dgv.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect;
dgv.CellValueChanged += new DataGridViewCellEventHandler(dgv_CellValueChanged);
dgv.CellBeginEdit += new DataGridViewCellCancelEventHandler(dgv_CellBeginEdit);
dgv.ColumnHeaderMouseClick += new DataGridViewCellMouseEventHandler(dgv_ColumnHeaderMouseClick);
dgv.CellMouseDown += new DataGridViewCellMouseEventHandler(dgv_CellMouseDown);
dgv.DataError += new DataGridViewDataErrorEventHandler(dgv_DataError);
dgv.CellEnter += new DataGridViewCellEventHandler(dgv_CellEnter);
dgv.KeyDown += new KeyEventHandler(dgv_KeyDown);
dgv.ColumnHeaderMouseDoubleClick += new DataGridViewCellMouseEventHandler(dgv_ColumnHeaderMouseDoubleClick);
// Load Page Contents
mainTabControl.SelectedTab.Tag = page;
dgv.Columns.Add("entryName", "Entry Name");
dgv.Columns[0].MinimumWidth = 150;
dgv.Columns[0].ValueType = typeof(string);
dgv.Columns[0].ReadOnly = true;
dgv.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
DGVColumnFilterContextControl colFilter = new DGVColumnFilterContextControl(dgv, 0);
dgv.SuspendDrawing();
foreach (CtfEntryInfo entryInfo in page.ctfEntryInfo)
{
dgv.Rows.Add(entryInfo.name);
dgv.Rows[entryInfo.id].HeaderCell.Value = Convert.ToString(entryInfo.id);
//entryInfo.id == 0 || entryInfo.id == 1 || entryInfo.refID >= 0 ||
if (entryInfo.readOnly)
{
dgv.Rows[entryInfo.id].ReadOnly = true;
}
}
dgv.ResumeDrawing();
mainTabControl.SelectedTab.Controls.Add(dgv);
ActiveControl = currentDgv;
}