altering vertical line based upon height of another control

  • Thread starter Thread starter a
  • Start date Start date
A

a

Hello,

i am trying to alter the height of a vertical line within a subreport.

i thought this would work but it is not:
Detail_Format()
me.lineleft.height= me.proddesc.height

End sub

i would like the height of "lineleft" to be dependant upon the height of
proddesc. any ideas why that does not work??

Thanks

Graham
 
a said:
i am trying to alter the height of a vertical line within a subreport.

i thought this would work but it is not:
Detail_Format()
me.lineleft.height= me.proddesc.height

End sub

i would like the height of "lineleft" to be dependant upon the height of
proddesc. any ideas why that does not work??


The problem is that the Height of a CanGrow control or its
section is not known until the Print event. The catch 22 is
that the Print event is too late to change the Height of the
line.

The alternative is to scrap the line control and draw the
line using the Line method in the Print event.

Me.Line (left,top)-Step(0,height)

You didn't say where the line is supposed to be so you'll
have to figure out what to use for left and top.
 
Thanks,

took your idea and used this code:

me.line (txtqty.left+txtqty.width,0)-(txtqty.left+txtqty.width,me.height+2)

Thanks again
 
You should be aware that Me.Height refers to the Height of
the section. Since the line will be cropped at the
section's boundaries, the +2 should be irrelevant. FYI, you
don't really need to use an exact value here, so instead of
Me.Height, you could have used any really large value such
as 30000 (I personally prefer Me.Height, so I am not
recommending you change that).

Also be aware of the Step option which allows you to specify
the relative positions of the line's endpoint instead of the
absolute coordinates. Again, this is not an especially
important issue, but it can simplify the statement:
Me.Line (txtqty.Left+txtqty.Width,0)-Step(0,Me.Height)
should produce the same result as the one you posted below.
 
Back
Top