Copy/Paste/Cut Texts

  • Thread starter Thread starter Saber S
  • Start date Start date
S

Saber S

I've 2 questions, and will first ask second ;)

I've 3 richtextboxes on my form and I've copy/paste/cut buttons (actually in
main menu)
How can I understand the text in wich richeditbox is selected to do e.g.:

If RichTextBox1.[Focused] Then ' ** {second question!}what I can put
instead of [Focused]?

Clipboard.SetDataObject(RichTextBox1.SelectedText)
'{first question} **what can i do for cut? i've to use a trick (copy, then
delete?)

End If
 
I would simply check for the ActiveControl:

If TypeOf ActiveControl Is RichTextBox1 Then
...
ElseIf TypeOf ActiveControl Is RichTextBox2 Then
...

and so forth.

As to how you "Cut" text, then Microsoft suggests
something like:
ActiveControl.Text = String.Empty

Hope that helps.
 
Back
Top