How to implment Copy, Paste, Cut in a MDI applcation?


Author
Message
Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi

I'm trying to implemet the Copy, Paste, Cut, Select all, Redo, Undo funtions. I have a MDI form with the Edit menu and several child forms, I try some methods but no one works:

   Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripMenuItem.Click

        My.Computer.Clipboard.Clear()

        If TypeOf Me.ActiveControl Is TextBox Then

            Dim objControl As TextBox = Me.ActiveControl

            My.Computer.Clipboard.SetText(objControl.SelectedText)

        ElseIf TypeOf Me.ActiveControl Is ComboBox Then

            Dim objControl As ComboBox = Me.ActiveControl

            My.Computer.Clipboard.SetText(objControl.Text)

        ElseIf TypeOf Me.ActiveControl Is PictureBox Then

            Dim objControl As PictureBox = Me.ActiveControl

            'My.Computer.Clipboard.SetData(objControl.Image)

        ElseIf TypeOf Me.ActiveControl Is ListBox Then

            Dim objControl As ListBox = Me.ActiveControl

            My.Computer.Clipboard.SetText(objControl.Text)

        Else

            ' No action makes sense for the other controls.

        End If

    End Sub

 

Some suggestions?

 

Regards

Smile Everything is possible, just keep trying...

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
What part is not working?  Does the clip text never make it into the clipboard?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search