Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Virginia, USA
    Thanked 0 Times in 0 Posts

    resize a graph for screen resolution (XP)

    I have a report with a bar graph. I designed it using a pc with 800x600 screen resolution and it looks fine. However, some users have chaged their screen to 1024x768 and the bar graph looks out of proportion on the page. Is there a way to scale the size of the graph based on each users screen settings? Some of the graph properties that I think may be relevant are Class: MSGraph.Chart.8 and OLE Class: Microsoft Graph Chart. Size Mode: Stretch.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: resize a graph for screen resolution (XP)

    You can resize the chart with the form by writing code in the On Resize event of the form. For a chart named cht:

    Private Sub Form_Resize()
    cht.Height = Me.InsideHeight - Me.FormHeader.Height - Me.FormFooter.Height - 1440
    cht.Width = Me.InsideWidth - 720
    End Sub

    The number 1440 and 720 are meant to ensure that the chart doesn't fill the entire detail section. You'll have to fine tune these values yourself. They are in twips (1 inch = 1440 twips).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts