70002128 Setting the cursor to Hand inside the OnFigureMouseOver event

Article 70002128
Type HowTo
Product Engine
Version 8
Date Added 1/5/2022 12:00:00 AM
Fixed 9.9003.0.4 (1/5/2022 12:00:00 AM)
Submitted by Mike Kruse

Summary

Setting the cursor to Hand inside the OnFigureMouseOver event

Solution

If you want to set the cursor inside the OnFigureMouseOver event you can use the base action's ShowCursor method like below

private void Doc_OnFigureMouseOver([System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.IDispatch)] object sender, vdFigure.FigureMouseEventArgs args)
        { 
            if (args.MouseAction == vdFigure.FigureMouseEventArgs.FigureMouseAction.MouseLeave)
            {
                if (doc.ActiveLayOut.ActiveAction is BaseAction)
                {
                    ((BaseAction)doc.ActiveLayOut.ActiveAction).ShowCursor(doc.ActiveLayOut.Render.GlobalProperties.ActionCursor);
                    doc.GlobalRenderProperties.ShowCursor = true;
                    
                }

            }
            else if (args.MouseAction == vdFigure.FigureMouseEventArgs.FigureMouseAction.MouseEnter)
            {
                if (doc.ActiveLayOut.ActiveAction is BaseAction)
                {
                    doc.GlobalRenderProperties.ShowCursor = false;
                    ((BaseAction)doc.ActiveLayOut.ActiveAction).ShowCursor(Cursors.Hand);
                }
            }
        }

Send comments on this topic.