Visual Basic 6.0 Mouse_Over/Hover to display Graph information

Hello everyone,
We have a system written in Visual Basic 6.0.  On the splash screen there are two pie charts.  I've been given the task of setting the setting the form up so when you hover over a section of the pie chart with your mouse it will display the data for that slice of the pie.  Any idea how to do this?  It seems every other application/development tool has this built in but VB 6.

I appreciate any help or ideas you have.

bfitch01
bfitch01Asked:
Who is Participating?
 
fds_fatboyConnect With a Mentor Commented:
The easiest way is to use MouseOver to get the X and Y location of a picturebox with your pie chart, use the X and Y to work out which slice you are over and place the details into the into the tooltiptext property of the control. Failing that, to get true MouseHover events you will have to subclass the picturebox control.
0
 
edwardiiiCommented:
Hi, bfitch01.

You could use a picture boxes MouseDown event as shown at this EE post:

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Controls/Q_20422895.html

Or, you could create an html page that mirrors the look of your splash screen (e.g. whatever text in addition to the two pie charts), and use image mapping to link to images/text that open in their own Web pages or as stand-alone images.  Then build a new splash page by filling a userform with a WebBrowser control, and setting BorderStyle to 0 (if desired).  Whenever users click on different sections of your new splash page, different data/images will popup.
0
 
edwardiiiConnect With a Mentor Commented:
Addition to the picturebox solution--you can get exact ranges by clicking on start/end points and doing:

     MsgBox "X= " & X & "     Y= " & Y

Once you've got the ranges down you can use IF/Then statements or Select/Case statements:

     If X >= 1000 And X <= 2000 And Y >= 405 And Y <= 1000 Then
         'cause a new image to appear (for example, in a separate userform.
     End If    
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
bfitch01Author Commented:
These charts are updated daily.  It sounds like the X/Y solution will only be valid for a static chart.  Is my interpretation correct?
0
 
fds_fatboyCommented:
No. Why should that be?
0
 
fds_fatboyCommented:
Sorry, I meant, if you have the data that produces the charts then it should be easy, just a bit of trigonometry. It would be easier still if you
draw the pie charts straight into the picture boxes. Also, you could look up the colour of the pixel under the mouse pointer this could be used to get which slice you are over.
If you don't have the data then you may be stuffed.
0
 
edwardiiiCommented:
Good questions regarding dynamic charts.  How are the charts added to the splash screen (e.g. what is the source of your charts)?
0
 
tonsofpcsCommented:
You basically need to build an Image map and calculate what pixels are within the regions.
0
 
bfitch01Author Commented:
They are built through a feed from SQL Server.  I figured out how to do it.  Thanks everyone for the help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.