MDI - Menu Cut/Copy/Paste Not Working Even With Shortcut Keys Disabled

Posted by: jasonmell on 8 September 2017, 2:03 pm EST

  • Posted 8 September 2017, 2:03 pm EST

    Working in Visual Studio with the latest version of Spread for Windows Forms (v4.0.3512). If you use Ctrl+C, etc. in the form directly and paste to Excel, there is no issue.  However, if you select information in the Spread and use the menu item to copy/cut and then paste in Excel, it never makes it to the clipboard. All I am using is SendKeys so its pretty weird that its not working this way. I have a sample project attached for your viewing/testing. Please let me know what I can do to get this rectified. Removing these menu options is not sufficient for this program.
    2009/09/testproj091609.zip
  • Replied 8 September 2017, 2:03 pm EST

    Also, these are the two forum references that state this should work after removing the Shortcut Keys

     

    http://www.clubfarpoint.com/Forums/forums/1/68164/ShowThread.aspx

    http://www.clubfarpoint.com/Forums/forums/thread/72410.aspx

  • Replied 8 September 2017, 2:03 pm EST

    Hello Jasonmell,

    You may use Spread's ClipBoard.Cut( ),Copy( ) & Paste( ) methods in order to perform these actions over Spread.Hence you may replace the code for Cut, Copy & Paste in your application with the below code,

     Private Sub CutToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CutToolStripMenuItem.Click
            If Form1.FpSpread1.Focused = True Then
                Form1.FpSpread1.ActiveSheet.ClipboardCut()
            Else
                SendKeys.Send("^X")
            End If
        End Sub

        Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CopyToolStripMenuItem.Click
            If Form1.FpSpread1.Focused = True Then
                Form1.FpSpread1.ActiveSheet.ClipboardCopy()
            Else
                SendKeys.Send("^C")
            End If
        End Sub

        Private Sub PasteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PasteToolStripMenuItem.Click
            If Form1.FpSpread1.Focused = True Then
                Form1.FpSpread1.ActiveSheet.ClipboardPaste()
            Else
                SendKeys.Send("^V")
            End If
        End Sub

    I hope it will help you.

    Thanks,

     

     

  • Replied 8 September 2017, 2:03 pm EST

    Hi Deepak,

    Thanks for the quick reply. In this test example, that solution would be OK.  I have a project that has over 100 forms and numerous spreads on each form.  Is there a better solution?  If not, I'd recommend Farpoint do something to handle the shortcut keys in an MDI window. 

     

    Much thanks,

    Jason

  • Replied 8 September 2017, 2:03 pm EST

    Hello Jason,

    The menu added to the MDI is preventing Spread from processing these Shortcut Keys.

    The best possible way that I can think of is to call Spread's Clipboard methods after checking if Spread has focus (as suggested earlier).You may loop through the Forms/Spreads in case you have a number of Forms/Spreads.

    I will pass on this request, of handling shortcut keys in an MDI window to the concerned team and will update you accordingly.

     

    Thanks,

     

     

  • Replied 8 September 2017, 2:03 pm EST

    Jason,

    I have reported this issue as a bug to our QA team (Bug Number: 27055) it should be fixed in our next maintenance release of Spread for Windows Forms.

     

    Thanks,

     

  • Replied 8 September 2017, 2:03 pm EST

    Much thanks to you and the QA Team!  Glad to be a Farpoint customer when things like this get rectified so fast! 

    Jason 

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels