Solved

Need help with  Mouse Pointer Trails or Cursor trails in VB6.  How do I do that effect like on DHTML pages?

Posted on 2004-08-30
4
371 Views
Last Modified: 2013-12-04
Ok, so this is a cheezy toy function and I know how to load custom animated cursors, but what I'd like to do on a specific form, or when a certain object is the focus, is have an animated object with transparency following the cursor around with an elastic effect.

How do I go about coding this in VB?  I've seen hundreds of examples in javascript for web pages, but can't find anything for applications development.  

Here's an example of one I am talking about.

http://www.dynamicdrive.com/dynamicindex13/trailer.htm

New to VB, and know no Javascript.

Thanks for the help.
0
Comment
Question by:CORUSCATE
4 Comments
 
LVL 5

Expert Comment

by:rsriprac
ID: 11939652
I would recommend that you create a image box of some sort.  For the image box, there should be a property along the lines of "on mouse move".  Use it to track the coordnates and place the trailing image following the mouse.  Hope this gives some ideas to get you started.

-Ram
0
 
LVL 5

Accepted Solution

by:
WesleySaysHi earned 250 total points
ID: 11939864
If you wish to download the code of a "simple particle effect" for VB6, go to:
http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=55596&lngWId=1

If you understand that code, then you can download more mouse effects from:
http://www.freevbcode.com/ShowCode.asp?ID=1859

All downloads are free.

In case you are new to this, you need to understand 3 events:
Form_MouseDown (Button As Integer, Shift As Integer, X as Single, Y As Single)
Form_MouseUp (Button As Integer, Shift As Integer, X as Single, Y As Single)
Form_MouseMove (Button As Integer, Shift as Integer, X as Single, Y As Single)

Be aware that a mouse is not an object. It has no properties and it has no methods. The arguments for each mouse event are exactly the same:
Button As Integer, Shift As Integer, X as Single, Y As Single

Both the MouseDown and MouseUp events will be executed, for the control over which the mouse cursor is positioned, if you press and release a mouse button
MouseMove event will happen by moving a mouse and it will also happen when you click a mouse button.
Clicking a mouse button or moving a mouse does not automatically make anything happen inside your program, unless you write code that executes inside the mouse events.

There are very good free tutorials on the net, if you are interested. Here is a list with short descriptions of the tutorials and clickable links:
http://www.tutorialized.com/tutorials/Visual-Basic/1

Regards,
Wesley
0
 

Author Comment

by:CORUSCATE
ID: 12160880
wesleySAYSHi gave a very quick and thorough answer that was appropriate for my programming knowledge.  My apologies for letting this question sit for so long, our internet access was down for 11 days and after that I was out of town attending a funeral.  This has put me behind on my masters thesis, so my apologies for the delay in assigning these (IMHO) points I have been preoccupied.  Best wishes and thanks, CORUSCATE
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Visual xHarbour 1 76
sumHeights2  challenge 7 76
pairs challenge 5 44
Looking for example pivot year code used in Y2K 4 48
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now