how about animated cursor in vb2008?
Post your questions regarding programming in Visual Basic 6 in here.
i put a cursor in my resources and i want to use it in my project
but i don't know how i can use it inside my form please teach me..
because i want to show my custom cursor in other computer without installing a my cursor.
tnx
sorry for my english
=====================================================================================
how about animated cursor.????
but i don't know how i can use it inside my form please teach me..
because i want to show my custom cursor in other computer without installing a my cursor.
tnx
sorry for my english
=====================================================================================
how about animated cursor.????
Last edited by utilities on Wed Oct 28, 2009 5:49 am, edited 1 time in total.
Hello,
First make sure your cursor is a *.cur file and then in its "Build Action" propertie choose "Embedded Resource".
Then add this code to the "Form_Load" event:
First make sure your cursor is a *.cur file and then in its "Build Action" propertie choose "Embedded Resource".
Then add this code to the "Form_Load" event:
Code: Select all
Happy coding! cooll; Me.Cursor = New Cursor(Me.GetType(), "YourCursorName.cur")
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Use a timer to do that.
Make a timer with interval 1 or something, upload the various cursor images, and each time the timer ticks it changes the cursor to the next image.
Make a timer with interval 1 or something, upload the various cursor images, and each time the timer ticks it changes the cursor to the next image.
Just a simple way:
You have a timer with... 1000 interval for example.
On the timer tick propertie you'll have to put something like this:
You have a timer with... 1000 interval for example.
On the timer tick propertie you'll have to put something like this:
Code: Select all
Cursor 1, 2 and 3 are the various cursor images (A Animated cursor is like a gIF, it has many "frames")If Cursor = cursor 1 then
Cursor = cursor 2
Elseif cursor = cursor 2 then
Cursor = cursor 3
Elseif cursor = cursor 3 then
Cursor = cursor 1
thx for that nery but i have a question
Why my cursor I put in my form is turning to black???
This is the code I put
Me.Cursor = New Cursor(Me.GetType(), "YourCursorName.cur")
is there way to put HD cursor using that code or using
other code.
Why my cursor I put in my form is turning to black???
This is the code I put
Me.Cursor = New Cursor(Me.GetType(), "YourCursorName.cur")
is there way to put HD cursor using that code or using
other code.
Mate, "YourCursorName.cur" must be replaced with your Cursor's image name... like "Cursor.cur"
Hello,
Add these imports to your project:
That works.
Add these imports to your project:
Code: Select all
Then underneath "Public Class Form.." add this code:Imports System.Runtime.InteropServices
Imports System.Reflection
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Code: Select all
Then in the "Form_Load" event use this: <DllImport("user32.dll")> _
Public Shared Function LoadCursorFromFile(ByVal filename As String) As IntPtr
End Function
Code: Select all
Then replace the code "C:\YourCursorName.cur" with the location and name of your cursor. Dim CustomCursor As New Cursor(Cursor.Current.Handle)
Dim colorcursorhandle As IntPtr = LoadCursorFromFile("C:\YourCursorName.cur")
CustomCursor.[GetType]().InvokeMember("handle", BindingFlags.[Public] Or BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.SetField, Nothing, CustomCursor, New Object() {colorcursorhandle})
Me.Cursor = CustomCursor
That works.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
There is a function in some properties called cursor. You can adjust its picture and animations in there.
If you want another object to react to the cursor then you can do so by using the mousehover feature.
Hope this helps!
Sincerely, Doctorfrost
If you want another object to react to the cursor then you can do so by using the mousehover feature.
Hope this helps!
Sincerely, Doctorfrost
Copyright Information
Copyright © Codenstuff.com 2020 - 2023