Line Objects

CJBIRKIN

Drink!
Local time
Today, 09:29
Joined
May 10, 2002
Messages
255
Hello

Fool that i am i'm trying to develop a dynamic cross tab report. I've nearly finished but i need to resize some lines on the report as the report width varies depending on how many columns i've got.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
dim Objcontrol as control
dim Intwidth as integer

Intwidth = me.Width

For Each Objcontrol In me

If TypeOf Objcontrol Is Line Then

??? objcontrol.width = Intwidth

End If

Next Objcontrol

I just can't figure out how to get the line to change. The actual loop works fine. Any suggestions greatfully received

Chris
 
Last edited:
In answer to my own question
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
DrawLine
End Sub


Sub DrawLine()
Dim rpt As Report, lngColor As Long
Dim sngTop As Single, sngLeft As Single
Dim sngWidth As Single, sngHeight As Single

Set rpt = Reports(Me.Name)
' Set scale to pixels.
rpt.ScaleMode = 1
' Top inside edge.
sngTop = rpt.ScaleTop
' Left inside edge.
sngLeft = rpt.ScaleLeft
' Width inside edge.
sngWidth = rpt.ScaleWidth
' Height inside edge.
sngHeight = 1
' Make color red.
lngColor = RGB(0, 0, 0)
' Draw line as a box.
rpt.Line (sngTop, sngLeft)-(sngWidth, sngHeight), lngColor, B

End Sub
 

Users who are viewing this thread

Back
Top Bottom