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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

777 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