Cut, Copy and Paste ?

DerekC

Member
Joined
May 5, 2009
Messages
20
Programming Experience
5-10
Hi,
I'm trying to implement cut, copy and paste functionality in my application. My menu is on the main form of my MDI application and I would like to cut copy or paste from any textbox from any mdichild. Any help would be appreciated.
 
Get the ActiveMdiChild and its ActiveControl, check if it is TypeOf TextBoxBase, CType/DirectCast to TextBoxBase type to access the Copy methods etc.
VB.NET:
If Me.ActiveMdiChild IsNot Nothing Then
    Dim c As Control = Me.ActiveMdiChild.ActiveControl
    If TypeOf c Is TextBoxBase Then
        CType(c, TextBoxBase).Copy()
    End If
End If
 
Thanks, but I keep getting the my Docking Manager as the current control which has a tab control inside it and then my textboxes. Is there any way of just cutting or copying ? The focus is on the textbox, with the text highlighted but I still get the docking manager as the current control. Any feedback would be appreciated.
 
Back
Top