StrataFrame Forum

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

http://forum.strataframe.net/Topic15572.aspx

By Juan Carlos Pazos - 4/12/2008

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

By Trent L. Taylor - 4/14/2008

What part is not working?  Does the clip text never make it into the clipboard?