當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。