Source/Controls/DataGridViewX.cs
(开头部分) 25KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
#if FRAMEWORK20
using System;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using DevComponents.DotNetBar.Rendering;
using System.Drawing.Drawing2D;
using System.Reflection;
using System.ComponentModel;
namespace DevComponents.DotNetBar.Controls
{
/// <summary>
/// Represents the DataGridView control with enhanced Office 2007 style.
/// </summary>
[ToolboxBitmap(typeof(DataGridViewX), "Controls.DataGridViewX.bmp")]
public class DataGridViewX : DataGridView
{
#region Private Variables
private int m_MouseOverColumnHeader = -2;
private int m_MouseDownColumnHeader = -2;
private int m_MouseDownRowIndex = -2;
private int m_MouseOverRowIndex = -2;
private bool m_Office2007StyleEnabled = true;
private Office2007DataGridViewColorTable m_ColorTable = null;
private Office2007ButtonItemStateColorTable m_ButtonStateColorTable = null;
private SelectionInfo[] m_ColumnSelectionState = new SelectionInfo[1];
//private int m_CurrentCellRowIndex = -1;
private int m_SelectedRowIndex = -2;
private bool m_HighlightSelectedColumnHeaders = true;
private bool m_SelectAllSignVisible = true;
private bool m_PaintEnhancedSelection = true;
#endregion
#region Constructor
public DataGridViewX()
: base()
{
SetupScrollBars();
}
#endregion
#region Internal Implementation
protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
{
bool enabled = this.Enabled;
Office2007DataGridViewColorTable ct = GetColorTable();
if (!m_Office2007StyleEnabled || ct == null ||
e.Handled || e.ColumnIndex >= 0 && e.RowIndex >= 0 &&
(!m_PaintEnhancedSelection || (e.State & DataGridViewElementStates.Selected) != DataGridViewElementStates.Selected))
{
base.OnCellPainting(e);
return;
}
Rectangle r = e.CellBounds;
Graphics g = e.Graphics;
LinearGradientColorTable bt = null;
Color borderColor = Color.Empty;
DataGridViewColumn column = null;
后面还有 567 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。