Exemplo n.º 1
0
Arquivo: Form1.cs Projeto: Gwee/csharp
        private void Button_Click(object sender, System.EventArgs e)
        {
            Button btn = (Button)sender;
            string str = btn.Text;

            switch (str)
            {
            case "Copy":
                if (TextBox1.SelectionLength > 0)
                {
                    TextBox1.Copy();
                }
                break;

            case "Cut":
                if (TextBox1.SelectionLength > 0)
                {
                    TextBox1.Cut();
                }
                break;

            case "Paste":
                TextBox1.Paste();
                break;

            case "Undo":
                TextBox1.Undo();
                break;
            }
        }
 private void menuItemUndo_Click(object sender, System.EventArgs e)
 {
     if (textBoxEdit.CanUndo == true)
     {
         textBoxEdit.Undo();
         textBoxEdit.ClearUndo();
     }
 }
Exemplo n.º 3
0
 /// <include file='doc\ToolStripTextBox.uex' path='docs/doc[@for="ToolStripTextBox.Undo"]/*' />
 public void Undo()
 {
     TextBox.Undo();
 }
Exemplo n.º 4
0
		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");
		}
Exemplo n.º 5
0
 //편집 > 실행 취소
 private void menuEditUndo_Click(object sender, System.EventArgs e)
 {
     mainTextBox.Undo();
 }
Exemplo n.º 6
0
 public void Undo()
 {
     txtEdit.Undo();
 }
 void MUndoClick(object sender, System.EventArgs e)
 {
     editorBox.Undo();
 }
Exemplo n.º 8
0
 private void undoClick(object sender, System.EventArgs e)
 {
     textBox.Undo();
 }