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


C# BaseCell.KeyEntersEditMode方法代码示例

本文整理汇总了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");
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:24,代码来源:DataGridViewCellTest.cs

示例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");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:64,代码来源:DataGridViewButtonCellTest.cs

示例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");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:64,代码来源:DataGridViewTextBoxCellTest.cs


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