OnZoom Event

  • Hello,


    I want to be able to change the size of markers on a chart as the user zooms in and out. I know that I can trap the mouse buttons and check for the zoom that way, but is there an 'OnZoom' event that I can trap in case the user uses the toolbar or menu to zoom?


    Thanks,


    Alan.

  • Re: OnZoom Event


    I dont think there is an on zoom event.... but doesnt the graph tick marks and point/plot marks get bigger automatically when you zoom in?


    Ger

    _______________________________________________
    There are 10 types of people in the world. Those that understand Binary and those that dont. :P


    Why are Halloween and Christmas the same? Because Oct 31 = Dec 25... ;)

    _______________________________________________

  • Re: OnZoom Event


    Ger,


    That is the problem, I want them to stay the same size on the screen as you zoom in. There is a map as a backdrop to the chart and the points are locations. Looking at the whole map means that a large marker covers a large area, but when you zoom in you want to be able to see the roads etc.


    Thanks,


    Alan.

  • Re: OnZoom Event


    Wow... tough call... the only thing I can think of is to check the activewindow zoom value every couple of seconds, but thats a kinda lame way of doing it...


    I'll let you know if I can think of something else.


    Ger

    _______________________________________________
    There are 10 types of people in the world. Those that understand Binary and those that dont. :P


    Why are Halloween and Christmas the same? Because Oct 31 = Dec 25... ;)

    _______________________________________________

  • Re: OnZoom Event


    Hmmmm ... No answer, just musing a bit, but does Zooming casue a calculate event?


    If it does, perhaps the current zoom value could be stored in a public variable and compared to the "new" zoom value when a calculate is triggered.

  • Re: OnZoom Event


    Hi,


    This will allow you to capture the zoom combobox changes and at least know that the menu View > Zoom was click.
    Standard code module[vba]Sub EnableZoomEvent()


    If g_clsZoomEvt Is Nothing Then
    Set g_clsZoomEvt = New CZoomEvt
    End If

    Set g_clsZoomEvt.MyZoom = Application.CommandBars.FindControl(Type:=msoControlComboBox, ID:=1733)
    Set g_clsZoomEvt.MyZoomMenu = Application.CommandBars.FindControl(Type:=msoControlButton, ID:=925)

    End Sub[/vba]
    Class module named CZoomEvt[vba]Option Explicit


    Public WithEvents MyZoom As CommandBarComboBox
    Public WithEvents MyZoomMenu As CommandBarButton


    Private Sub MyZoom_Change(ByVal Ctrl As Office.CommandBarComboBox)


    MsgBox Ctrl.Text

    End Sub
    Private Sub MyZoomMenu_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
    ' at least you know button was pressed
    MsgBox Ctrl.Caption


    End Sub[/vba]

    [h4]Cheers
    Andy
    [/h4]

  • Re: OnZoom Event


    Thanks Gents,


    I will try to use this. I suspect that my current solution of a custom menu item that increases and decreases the size of the marker for the selected series will suffice. As always time is at a premium.


    Alan.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!