Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Oh cool, do you know how to use the cursor files, like how to make them work on the application? Oh dur...

 

On the form I just remembered there was an icon property, well I'll brb I'm going to check it out. Trying out myself --> MSDN --> Google --> Then I'm back here.

"Reality is fake, Dreams are for real"
  • *Experts*
Posted

You have to use the Cursor property of your form to set it. You would have to set the custom cursor from code as you cant do it in the designer.

Me.Cursor = New System.Windows.Forms.Cursor("filename, stream or handle to the cursor")

Posted

Dangit, just when I figured things out lol.

 

This is what I got:

 

1) Right-click solutions, add either new item (cursor file), or an existing cursor file that you can browse.

 

2) Select the cursor that's on the solution explorer, make the file an embedded source.

 

3) Now if your project name is: Cursorz

And the cursor name in your project is: Cursor1

 

Then this code should work 100%:

 

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       Dim s As System.IO.Stream

       Try
           s = Me.GetType().Assembly.GetManifestResourceStream("Cursorz.Cursor1.cur")
           Me.Cursor = New Cursor(s)

       Catch Ex As Exception
           MessageBox.Show(Ex.Message, "No Stream!")

       Finally
           If Not IsNothing(s) Then _
           s.Close()
       End Try

   End Sub

 

BTW I copied this from: Here

"Reality is fake, Dreams are for real"
  • Leaders
Posted

you dont really need to even add the IO.Stream , here's 2 ways to add the new cursor....

way1 :

MyBase.Cursor = New Cursor(Me.GetType().Assembly.GetManifestResourceStream("count_down.Cursor1.cur"))

way2:

MyBase.Cursor = New Cursor(GetType(Form1).Assembly.GetManifestResourceStream("count_down.Cursor1.cur"))

hope it helps.

  • 2 weeks later...
  • Leaders
Posted

Back to the black and white thing... I used code along these lines:

 

me.cursor = new cursor(filename.cur)

 

and even though the file contained a colored cursor, it displayed in black and white. Will using any other methods on this page result in colored cursors?

[sIGPIC]e[/sIGPIC]

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...