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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

828 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