• Mouse events on graph object? (Graph 97/ Access 97)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Mouse events on graph object? (Graph 97/ Access 97)

    Author
    Topic
    #377557

    I have a graph object in an Access 97 form, and would like to be able to obtain coordinates where the mouse is clicked on the graphic object. Is this possible? I’ve tried the MouseUp and MouseDown events of the detail section — which returns XY positions in ??? coordinate system. Tried the same events on the graphic object itself — no response. The graph is of XY type – my real goal is to get the mouse position in the coordinate system (scale) of the XY graph.

    Any ideas?

    Viewing 1 reply thread
    Author
    Replies
    • #622142

      Reports are not interactive, even those with graphs on them. What are you trying to accomplish? Any mouse position you get is going to be relative to the upper left corner of the window it’s in, not to anything on the graph.

      • #622249

        The graph is on a form — not on a report.

        The graph displays XY coordinates that are latitude/longitude pairs of GPS data. I want to zoom into the graph by digitizing lower-left, upper-right coordinates using the mouse. I’ve been able to zoom in and out of the graph using command buttons that change the X and Y scales of the graph, but it’s too cumbersome to be workable. I thought if I could capture user-defined XY coordinates that I could use those coordinates to reset the graph’s scale.

        Sorry for the confusion about Access vs VBA board — I thought the VBA board was more appropriate because the graph control is non-application specific.

        • #622270

          No need to apologize. The graph object is generic across applications, but Access forms and reports are not the same as objects in other Office applications and code to manipulate an Access form isn’t the same as code to manipulate an MS form.

          What code are you using behind a command button to do this?

          • #622274

            I know the current center and range of the XY data (obtained from a query on the data itself). The command buttons change the minimum and maximum ScaleX and ScaleY of the XY graph by a factor of *2 or /2, depending on which button was pressed. Essentially, it zooms the centre of the graph, and it works kinda-sorta if the area of interest is centered in the graph. Problem arises when the user wants to zoom an arbitrary location.

            What I am trying to do is to display some rudimentary, geographic data using just standard controls — enough to satisfy some simple user requirements. This whole thing is a proof-of-concept idea that I might just abandon. At this point, I’ve satisfied myself that I’m not overlooking something obvious in the graph control, and any “scaling” function will likely be a roll-your-own solution. I’ve downloaded the article that Rupert suggested — it looks promising.

    • #622260

      This 1996 article by Michael Kaplan may be of interest to you. A working DB is also available for down load. It works with a bitmap, I don

    Viewing 1 reply thread
    Reply To: Mouse events on graph object? (Graph 97/ Access 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: