🌶️ Eyeshot issues with Infragistics controls

Issue 1: Docking control and draw overlay

If you need to customize the Eyeshot control by drawing a text in the overlay, you will get an error during docking/undocking operations with Infragistics control.

To overcome this, you can use the below trick:

using System.Runtime.InteropServices;
class MyDesign : Design { protected override void DrawOverlay(DrawSceneParams data) { base.DrawOverlay(data); // Check if the parent Window handle is valid before drawing the text. if (IsWindow(this.GetParentHandle())) // available since Eyeshot 2020.2.259 { Font myFont = this.Font; DrawText(5, 5, "Test", myFont, Color.Black, ContentAlignment.BottomLeft); } } [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool IsWindow(IntPtr hWnd); }
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.

Articles in this section