Wrox Programmer Forums
|
Visual Basic 2008 Essentials If you are new to Visual Basic programming with version 2008, this is the place to start your questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Essentials section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2009, 07:03 AM
Registered User
 
Join Date: Feb 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mousehover

Code:
Private Sub frmGraphTT_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseHover
        sender = ChartBox
        Dim XYpoint As Point
        XYpoint.X = MousePosition.X
        XYpoint.Y = MousePosition.Y
        'ChartBox.onmousehover(e) - gives a Protected error?

        If Cregion.IsVisible(XYpoint.X, XYpoint.Y) = True Then
            Debug.Print("1209 hit")
        Else
            Debug.Print("1216 miss")

        End If
    End Sub
I have a form with a picturebox called Chartbox and I'm trying to fire a mousehover event when the mouse is over a drawn region (Cregion). My code is not working, can anyone help, please?
 
Old September 14th, 2009, 03:33 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

Quote:
Originally Posted by Tycoon Ted View Post
Code:
Private Sub frmGraphTT_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseHover
        sender = ChartBox
        Dim XYpoint As Point
        XYpoint.X = MousePosition.X
        XYpoint.Y = MousePosition.Y
        'ChartBox.onmousehover(e) - gives a Protected error?

        If Cregion.IsVisible(XYpoint.X, XYpoint.Y) = True Then
            Debug.Print("1209 hit")
        Else
            Debug.Print("1216 miss")

        End If
    End Sub
I have a form with a picturebox called Chartbox and I'm trying to fire a mousehover event when the mouse is over a drawn region (Cregion). My code is not working, can anyone help, please?

For starters
Code:
sender = ChartBox
The value of the sender should be assigned to an object

Secondly why are you trying to fire an onmousehover event when you haven't check to see if the box is currently under the mouse

Thirdly you should be using the picture boxes mousehover event to check whether its over a region!

And just to give you a hint look at a special property within the control which converts locations into control locations and stuff!

Goodluck
__________________
Apocolypse2005, I'm a programmer - of sorts.









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.