Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
If you add a cursor as a resource, how can you then use it? I'm having some trouble - I just get the message that an array of bytes cannot be converted to a cursor.
  • Leaders
Posted

You are compiling the cursor as an embedded resource, right?

[Vb]

'VB

Dim X As New Cursor(Me.GetType, "Rootnamespace.Filename.withextension")

 

// 'C#

// 'subfolders is the folder relative to the project path, and should be

// 'omitted if the cursor is in the root project path

Cursor(X = New Cursor(this.GetType(),

"Rootnamespace.subfolders.Filename.withextension"))

[/code]

[sIGPIC]e[/sIGPIC]
Posted
Thanks, but doesn't seem to work. I just get an Object is Nothing error. I take it "rootnamespace" in your code should be the name given to my project under that heading in the Application tab of the project?
  • Leaders
Posted
The root namespace will be the name of the project unless you have explicitly changed it. Make sure that the "Compile Action" property of the icon file is set to "Embedded Resource".
[sIGPIC]e[/sIGPIC]
Posted
The root namespace will be the name of the project unless you have explicitly changed it. Make sure that the "Compile Action" property of the icon file is set to "Embedded Resource".

Can see no such property.

Posted
Aha! Got it at last! If you select the cursor in the Resources tab, as I had done before, you get an entirely different set of properties than if you select it through the "Solution Explorer". Don't know why. But anyway, selecting it through the Solution Explorer does give the Build Action property. If I set that, and then you use your code, but omitting the Rootnamespace qualifier, it works! Thanks.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...