Print Page | Close Window

Copy chart to clipboard

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Chart Control
Forum Description: Topics Related to Codejock Chart Control
URL: http://forum.codejock.com/forum_posts.asp?TID=24584
Printed Date: 03 February 2026 at 8:18pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Copy chart to clipboard
Posted By: wopag
Subject: Copy chart to clipboard
Date Posted: 22 July 2025 at 2:58am


HI,

We just upgraded from v15 to 24 version.  We are just getting over the differences in the versions but have noticed that the copy to clipboard method we were using no longer works.


    Clipboard.Clear
    DoEvents
    Picture1.Cls
    Picture1.Width = Me.ChartControl.Width
    Picture1.Height = Me.ChartControl.Height
    Me.ChartControl.PrintToDC Picture1.hDC, -1, -1, Me.ChartControl.Width / Screen.TwipsPerPixelX, Me.ChartControl.Height / Screen.TwipsPerPixelY
    Clipboard.SetData Picture1.Image, vbCFBitmap




Using a a 3d Pie chart only copies the legend - it ignores the chart?

/Stu




Replies:
Posted By: agontarenko
Date Posted: 21 January 2026 at 7:48am
Hello,

I've checked ChartBrowser sample 24.3v and try to 'File -> Copy To Clipboard' then paste into paint. All works as exected.
This is function from sample. May be you use old method.

Private Sub cmdCopyToClipboard_Click()
    If ActiveChartControl.CopyToClipboard(ActiveChartControl.Width, ActiveChartControl.Height) Then
        MsgBox "Chart image has been copied to clipboard", vbInformation
    Else
        MsgBox "Chart image has not been copied to clipboard due to internal error", vbExclamation
    End If
        
End Sub

Use please ActiveChartControl.CopyToClipboard function istead you code

Regards,
Artem Gontarenko



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net