Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Line method problems (2000/XP)

    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.

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Line method problems (2000/XP)

    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.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Line method problems (2000/XP)

    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.

Posting Permissions

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