locked
Invisible cursor reappears in parent window when child window opens. RRS feed

  • Question

  • I am developing a WES7 app in C# and my app has only a touch screen. The customer desires that the mouse cursor is never visible.

    In all of the windows for the application, I have set

    ForceCursor = True and Cursor = None

    This works as intended for the first window until another window is displayed on top of the present window. The normal mouse cursor appears outside the boundaries of the new window, but not in the new window.

    Any suggestions?


    Embedded Medical Developer
    Thursday, December 1, 2011 7:06 PM

All replies

  • I am developing a WES7 app in C# and my app has only a touch screen. The customer desires that the mouse cursor is never visible.

    In the app.xaml.cs module the following code appears in public partial class App : Application.

    Mouse.OverrideCursor = System.Windows.Input.Cursors.None;

    This works as intended until another window is displayed. At this time the normal mouse cursor appears outside the boundaries of the new window, but not in the new window.

    I have tried setting the cursor property in the new window, but this has no effect.

    Any suggestions?

     

     


    Embedded Medical Developer

     



    • Edited by Dan Vahle Tuesday, November 29, 2011 4:50 PM
    • Merged by Lie You Monday, December 5, 2011 2:24 AM Merge them to keep into the same topic for good discussion
    Tuesday, November 29, 2011 4:06 PM
  • Hi Dan Vahle,

    This is happening perhaps because you need to set the Cursor to None for all winforms you have in your application.I am not sure about it though

    Thanks,

    BR

    JollyWagoner

    Tuesday, November 29, 2011 6:55 PM
  • Have you tried to create a null cursor icon to replace the arrow icon?

    -Sean


    www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - Pro Guide to WES 7, XP Embedded Advanced, Pro Guide to POS for .NET
    Thursday, December 1, 2011 7:11 PM
  • Sean,

    I still need the mouse for the touch screen application, so I replace the cursor with an invisible cursor.

    Dan

    public partial class App : Application
    {
         /// <summary>
         /// Cursor object for an invisible cursor
         /// </summary>
         public Cursor InvisibleCursor;
    
         public App()
         {
                    InvisibleCursor = new Cursor(System.IO.Path.GetFullPath("..\\..\\Resources\\Cursor1.cur"));
            Mouse.OverrideCursor = InvisibleCursor;
         }
    
    }

     


    Embedded Medical Developer
    Thursday, December 1, 2011 10:04 PM