rbulph Posted November 3, 2005 Posted November 3, 2005 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. Quote
Leaders snarfblam Posted November 3, 2005 Leaders Posted November 3, 2005 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] Quote [sIGPIC]e[/sIGPIC]
rbulph Posted November 4, 2005 Author Posted November 4, 2005 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? Quote
Leaders snarfblam Posted November 4, 2005 Leaders Posted November 4, 2005 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". Quote [sIGPIC]e[/sIGPIC]
rbulph Posted November 4, 2005 Author Posted November 4, 2005 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. Quote
rbulph Posted November 4, 2005 Author Posted November 4, 2005 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.