本文整理汇总了C#中System.Windows.Forms.DataGridViewCellStyle.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewCellStyle.ToString方法的具体用法?C# DataGridViewCellStyle.ToString怎么用?C# DataGridViewCellStyle.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataGridViewCellStyle
的用法示例。
在下文中一共展示了DataGridViewCellStyle.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DgDr_KeyDown
private void DgDr_KeyDown(object sender, KeyEventArgs e)
{
try
{
if (DgDr.CurrentRow != null)
{
int GId = DgDr.CurrentRow.Cells["ColParticularDrGId"].EditedFormattedValue.ToString().IntParse();
int AId = DgDr.CurrentRow.Cells["ColParticularDrAId"].EditedFormattedValue.ToString().IntParse();
if (e.KeyData == Keys.Enter)
{
e.SuppressKeyPress = true;
e.Handled = true;
//if (AId != 0)
//{
// clsGeneral.Accounting_Main.OpMonthlySummary(AId, dateTimePicker1.Value, this);
//}
//else
//{
// clsGeneral.Accounting_Main.OpgroupSummary(GId, dateTimePicker1.Value, this);
//}
}
if (e.KeyData == Keys.Space)
{
e.SuppressKeyPress = true;
e.Handled = true;
DataGridViewCellStyle CompStyle1 = new DataGridViewCellStyle();
CompStyle1.ForeColor = Color.Red;
CompStyle1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
DataGridViewCellStyle CompStyle2 = new DataGridViewCellStyle();
CompStyle2.ForeColor = Color.Black;
CompStyle2.Font = new System.Drawing.Font("Tahoma", 9.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
if (DgDr.CurrentRow.DefaultCellStyle.ToString() == CompStyle1.ToString() || DgDr.CurrentRow.DefaultCellStyle.ToString() == CompStyle2.ToString())
{
int Index = DgDr.CurrentRow.Index;
for (int i = Index + 1; i < DgDr.Rows.Count; i++)
{
int GCId = DgDr.Rows[i].Cells["ColParticularDrGId"].EditedFormattedValue.ToString().IntParse();
if (GId == GCId)
{
DgDr.Rows[i].Visible = !DgDr.Rows[i].Visible;
}
}
DgDr.Refresh();
}
}
}
}
catch (Exception Erp)
{
clsGeneral.ShowErrMsg(Erp.Message);
}
}