本文整理汇总了C#中System.Windows.Forms.TextBox.Cut方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.Cut方法的具体用法?C# TextBox.Cut怎么用?C# TextBox.Cut使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TextBox
的用法示例。
在下文中一共展示了TextBox.Cut方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ModifiedTest
public void ModifiedTest ()
{
TextBox t = new TextBox ();
Assert.AreEqual (false, t.Modified, "modified-1");
t.Modified = true;
Assert.AreEqual (true, t.Modified, "modified-2");
t.Modified = false;
Assert.AreEqual (false, t.Modified, "modified-3");
// Changes in Text property don't change Modified,
// as opposed what the .net docs say
t.ModifiedChanged += new EventHandler (TextBox_ModifiedChanged);
modified_changed_fired = false;
t.Text = "TEXT";
Assert.AreEqual (false, t.Modified, "modified-4");
Assert.AreEqual (false, modified_changed_fired, "modified-4-1");
t.Modified = true;
modified_changed_fired = false;
t.Text = "hello";
Assert.AreEqual (true, t.Modified, "modified-5");
Assert.AreEqual (false, modified_changed_fired, "modified-5-1");
t.Modified = false;
modified_changed_fired = false;
t.Text = "hello mono";
Assert.AreEqual (false, t.Modified, "modified-6");
Assert.AreEqual (false, modified_changed_fired, "modified-6-1");
// The methods changing the text value, however,
// do change Modified
t.Modified = true;
modified_changed_fired = false;
t.AppendText ("a");
Assert.AreEqual (false, t.Modified, "modified-7");
Assert.AreEqual (true, modified_changed_fired, "modified-7-1");
t.Modified = true;
modified_changed_fired = false;
t.Clear ();
Assert.AreEqual (false, t.Modified, "modified-8");
Assert.AreEqual (true, modified_changed_fired, "modified-8-1");
t.Text = "a message";
t.SelectAll ();
t.Modified = false;
t.Cut ();
Assert.AreEqual (true, t.Modified, "modified-9");
t.Modified = false;
t.Paste ();
Assert.AreEqual (true, t.Modified, "modified-10");
t.Modified = false;
t.Undo ();
Assert.AreEqual (true, t.Modified, "modified-11");
}