本文整理汇总了C#中System.Windows.Forms.DataGridView.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridView.Equals方法的具体用法?C# DataGridView.Equals怎么用?C# DataGridView.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataGridView
的用法示例。
在下文中一共展示了DataGridView.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataGridView_Click
private void DataGridView_Click(object sender, EventArgs e)
{
DataGridView dgv2 = null;
DataGridView.HitTestInfo hit;
try
{
m_ClickedDGVArgs = (MouseEventArgs)e;
if(m_ClickedDGVArgs.Button == System.Windows.Forms.MouseButtons.Right)
{
m_ClickedDGV = (DataGridView)sender;
hit = m_ClickedDGV.HitTest(m_ClickedDGVArgs.X, m_ClickedDGVArgs.Y);
if (hit.Type == DataGridViewHitTestType.TopLeftHeader)
{
DataGridViewSettings Tool = new DataGridViewSettings();
if(m_ClickedDGV.Equals(dgvStation1))
dgv2 = dgvStation2;
else if(m_ClickedDGV.Equals(dgvStation2))
dgv2 = dgvStation1;
if(Tool.setVisibility(m_ClickedDGV) == DialogResult.OK)
{
m_GUIInterface.saveSetting(m_ClickedDGV);
if(dgv2 != null)
{
DataGridViewSettings.CloneSettings(ref m_ClickedDGV, ref dgv2);
m_GUIInterface.saveSetting(dgv2);
}
}
}
else if (hit.Type == DataGridViewHitTestType.Cell)
{
if(m_ClickedDGV.Equals(dgvStationToStationRoutes))
{
contextMenuStrip2.Show(m_ClickedDGV, m_ClickedDGVArgs.Location);
}
else if(m_ClickedDGV.Equals(dgvAllCommodities))
{
contextMenuStrip3.Show(m_ClickedDGV, m_ClickedDGVArgs.Location);
}
else
{
contextMenuStrip1.Show(m_ClickedDGV, m_ClickedDGVArgs.Location);
}
}
}
}
catch (Exception ex)
{
CErr.processError(ex, "Error while changing DataGridView settings");
}
}
示例2: FormatNumber
//格式化首列
private void FormatNumber(ref DataGridView dgv)
{
if (dgv.Equals(dgvGBNR)) //工步内容特殊处理
{
FormatGBNR();
}
else
{
for (int i = 0; i < dgv.RowCount; i++)
{
dgv[0, i].Value = (i + 1).ToString();
}
}
}