Search the Community
Showing results for tags 'winforms'.
Hi ChartFX community. I'm trying to get the device context handle for a chart and appropriately release it as well. Here is the code I have that isn't working. I feel that I am close and just need a bit of a nudge to fix it. Dim hDeviceC as IntPtr Dim hwnd As IntPtr hwnd = chart1.Handle hDeviceC = Graphics.FromHwnd(hwnd).GetHdc ... ... ... Graphics.FromHwnd(hwnd).ReleaseHdc(hDeviceC) The error appears on the last line. I also tried the following, but couldn't find a way to connect "e" to my chart - as denoted by the "missing line" Dim e As ChartFX.WinForms.CustomPaintEventArgs <MISSING LINE> hDeviceC = e.Graphics.GetHdc ... ... ... e.Graphics.ReleaseHdc(hDeviceC) Which of these approaches is appropriate? And what am I missing in either case? Thanks, and kind regards, -Colin