setting a cursor to an embedded resource cursor

Hi,

can anyone help me with the syntax of setting a cursor to an embedded resource. I already added my cursor to my project and tried this
Cursor c = new Cursor(GetType(), "cursor1.cur");
this didn't work

thanks in advance,
kimme


Answer this question

setting a cursor to an embedded resource cursor

  • Brian Lyttle

    Well, when I'm using the windows.forms class, I get an convert error. It seems that WinFX uses windows.input.cursor for it images and the compiler can't convert windows.forms.cursor to them. When I don't us Windows.forms.cursor, the error is an argument overload because windows.input.cursor expects only 1 argument. String cursorfile or stream cursorstream

  • francisk

    Sorry, i don't have experience with WinFX. But you can still use the .NET classes when you are working with WinFX, so why it doesn't work Do you get an exception or can't you compile the code because of errors


  • Amardon

    This should work, do you get any exceptions
    Did you make sure your cursor is marked as Embedded Resource

    The documentation about this ctor: Cursor Constructor (Type, String).


  • Aksh_bvn

    You can take a look at the MSAvalon.Windows.Input.CursorTypeConverter.

  • BigSquare

    I do have to say that I'm working in VS.NET 2005 and not using windows forms, but WinFX Window, or shouldn't that make any difference I found out that the cursor I'm using is of the type System.windows.input.cursor :-s

  • setting a cursor to an embedded resource cursor