• Line method problems (2000/XP)

    Author
    Topic
    #452104

    I’m trying to draw lines on a report at runtime using this code in the Print event of the Detail section. All the controls in the detail section section are able to grow.

    Me.ScaleMode = 6 ‘millimetres
    Me.DrawWidth = 4
    Me.DrawStyle = 0

    ‘vertical lines
    Me.Line (15, 0)-Step(0, Me.Height), vbRed
    Me.Line (52.91, 0)-Step(0, Me.Height), vbRed
    Me.Line (87.92, 0)-Step(0, Me.Height), vbRed
    Me.Line (122.93, 0)-Step(0, Me.Height), vbRed
    Me.Line (157.4, 0)-Step(0, Me.Height), vbRed

    ‘horizontal line along top
    Me.Line (0, 0)-(195, 0), vbRed

    It ‘sort of’ works. But I have a chunk of records where the vertical lines fail to draw. Well, they appear try to draw something, just a tiny mm-ish line at the top of the affected rows.

    Any idea what’s causing this?

    Also, I can’t figure out how to draw a line at the bottom/underneath the detail.

    Viewing 0 reply threads
    Author
    Replies
    • #1115178

      Seems happier with this

      Me.Line (15, 0)-Step(0, (Me.Height) / 56.7), vbBlack
      Me.Line (52.91, 0)-Step(0, (Me.Height) / 56.7), vbBlack
      Me.Line (87.92, 0)-Step(0, (Me.Height) / 56.7), vbBlack
      Me.Line (122.93, 0)-Step(0, (Me.Height) / 56.7), vbBlack
      Me.Line (157.4, 0)-Step(0, (Me.Height) / 56.7), vbBlack

      and this for a line along the bottom
      Me.Line (0, (Me.Height) / 56.7)-Step((Me.Width) / 56.7, (Me.Height) / 56.7), vbBlack, B

      Still confused with the DrawWidth property. I’ve read it’s supposed to be pixels but to get something approximating to a 1pt line I used DrawWidth = 15.

      • #1115230

        The documentation for the Line method is incomplete, and what’s there is incorrect. I{ think trial-and-error and searching for examples on the Internet are the only ways to get to grips with it.

    Viewing 0 reply threads
    Reply To: Line method problems (2000/XP)

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

    Your information: