当前位置: 首页>>代码示例>>C#>>正文


C# DataGridView.ResumeDrawing方法代码示例

本文整理汇总了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;
 }
开发者ID:BennyKJohnson,项目名称:Ego-Engine-Modding,代码行数:80,代码来源:Form1.cs


注:本文中的System.Windows.Forms.DataGridView.ResumeDrawing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。