Exemple #1
0
        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 menuItemCut_Click(object sender, System.EventArgs e)
 {
     if (textBoxEdit.SelectedText != "")
     {
         textBoxEdit.Cut();
     }
 }
Exemple #3
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");
		}
 private void menuCut_Click(object sender, System.EventArgs e)
 {
     textBox.Cut();
 }
Exemple #5
0
 //편집 > 잘라내기
 private void menuEditCut_Click(object sender, System.EventArgs e)
 {
     mainTextBox.Cut();
 }
Exemple #6
0
 public void Cut()
 {
     txtEdit.Cut();
 }
 void MCutClick(object sender, System.EventArgs e)
 {
     editorBox.Cut();
 }