本文整理汇总了C#中BaseCell.KeyEntersEditMode方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCell.KeyEntersEditMode方法的具体用法?C# BaseCell.KeyEntersEditMode怎么用?C# BaseCell.KeyEntersEditMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseCell
的用法示例。
在下文中一共展示了BaseCell.KeyEntersEditMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MethodKeyEntersEditMode
public void MethodKeyEntersEditMode ()
{
bool result = false;
DataGridViewCell c = new BaseCell ();
foreach (Keys k in Enum.GetValues (typeof (Keys)))
result |= c.KeyEntersEditMode (new KeyEventArgs (k));
Assert.AreEqual (false, result, "A1");
DataGridView dgv = new DataGridView ();
dgv.Columns.Add ("hi", "there");
DataGridViewRow row = new DataGridViewRow ();
row.Cells.Add (c);
dgv.Rows.Add (row);
result = false;
foreach (Keys k in Enum.GetValues (typeof (Keys)))
result |= dgv.Rows[0].Cells[0].KeyEntersEditMode (new KeyEventArgs (k));
Assert.AreEqual (false, result, "A2");
}
示例2: MethodKeyEntersEditMode
public void MethodKeyEntersEditMode ()
{
string result = string.Empty;
string expected = string.Empty;
DataGridViewCell c = new BaseCell ();
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (c.KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A1");
DataGridView dgv = new DataGridView ();
dgv.Columns.Add ("hi", "there");
DataGridViewRow row = new DataGridViewRow ();
row.Cells.Add (c);
dgv.Rows.Add (row);
result = string.Empty;
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (dgv.Rows[0].Cells[0].KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A2");
result = string.Empty;
dgv.EditMode = DataGridViewEditMode.EditOnEnter;
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (dgv.Rows[0].Cells[0].KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A3");
result = string.Empty;
dgv.EditMode = DataGridViewEditMode.EditOnF2;
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (dgv.Rows[0].Cells[0].KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A4");
result = string.Empty;
dgv.EditMode = DataGridViewEditMode.EditOnKeystroke;
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (dgv.Rows[0].Cells[0].KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A5");
result = string.Empty;
dgv.EditMode = DataGridViewEditMode.EditProgrammatically;
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (dgv.Rows[0].Cells[0].KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A6");
}
示例3: MethodKeyEntersEditMode
public void MethodKeyEntersEditMode ()
{
string result = string.Empty;
string expected = "32;48;49;50;51;52;53;54;55;56;57;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;82;83;84;85;86;87;88;89;90;96;97;98;99;100;101;102;103;104;105;106;107;108;109;110;111;170;181;186;186;187;188;189;190;191;191;192;192;219;219;220;220;221;221;222;222;223;226;226;229;231;246;248;249;250;251;252;253;254;";
DataGridViewCell c = new BaseCell ();
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (c.KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A1");
DataGridView dgv = new DataGridView ();
dgv.Columns.Add ("hi", "there");
DataGridViewRow row = new DataGridViewRow ();
row.Cells.Add (c);
dgv.Rows.Add (row);
result = string.Empty;
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (dgv.Rows[0].Cells[0].KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A2");
result = string.Empty;
dgv.EditMode = DataGridViewEditMode.EditOnEnter;
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (dgv.Rows[0].Cells[0].KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A3");
result = string.Empty;
dgv.EditMode = DataGridViewEditMode.EditOnF2;
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (dgv.Rows[0].Cells[0].KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A4");
result = string.Empty;
dgv.EditMode = DataGridViewEditMode.EditOnKeystroke;
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (dgv.Rows[0].Cells[0].KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A5");
result = string.Empty;
dgv.EditMode = DataGridViewEditMode.EditProgrammatically;
foreach (Keys k in Enum.GetValues (typeof (Keys)))
if (dgv.Rows[0].Cells[0].KeyEntersEditMode (new KeyEventArgs (k)))
result += ((int)k).ToString () + ";";
Assert.AreEqual (expected, result, "A6");
}