none
how to get the mouse's cursor type?

    Question

  • hello,everyone:

    I have a app,when the mouse point move around the app, the mouse cursor can change into different type in different place. so I want to get the mouse cursor type sometimes. but how to do it?

     

    now I have the code as follows:

        <Grid>
          <InkCanvas EditingMode ="Select" MouseMove="CanvasMove">
            <Button Width ="100" Height ="80" Content ="Click"/>
          </InkCanvas>       
        </Grid>

     

    the code-behind is:

     

            void CanvasMove(object sender, object args)
            {
                InkCanvas ink = (InkCanvas)sender;

                if (ink.Cursor != null)
                {
                    Cursors.Cross
                    Console.WriteLine(ink.Cursor.ToString());
                }
            }

     

    but the ink.Cursor is always null.

     

    so please give some tips

     

    thanks

     

    Wednesday, October 31, 2007 7:30 AM

All replies

  • ink.Cursor is always null Coz you are not setting it

    Code Block

    <InkCanvas EditingMode ="Select" MouseMove="CanvasMove" Cursor="Cross">



    Wednesday, October 31, 2007 9:11 AM
  •  

    thanks for your answer!

     

    when I select a component in the InkCanvas, the border of the selected component has the shadow, when I move the mouse over the shadow, the cursor will change into another type. so how can I get this type, but I needn't to set the cursor type.

    Thursday, November 01, 2007 1:32 AM