'Обрисовка линиями или прямоугольником
Public Sub Obrisovka(MyReportSection As Section, Optional L_Color As Long = vbBlack, Optional BBF As Boolean = True)
Dim ctl As Control, lngHeight As Long
On Error GoTo DrawTableInDetailSectionStep_Error
With MyReportSection
For Each ctl In .Controls
If ctl.Visible = True And ctl.Height + ctl.Top > lngHeight Then lngHeight = ctl.Height + ctl.Top
Next ctl
'Рисyем pамки вокруг всех элементов раздела
For Each ctl In .Controls
Select Case BBF
Case True
If ctl.Visible = True Then .Parent.Line (ctl.Left, ctl.Top)-Step(ctl.Width, lngHeight), L_Color, B
Case False
If ctl.Visible = True Then .Parent.Line (ctl.Left, ctl.Top)-Step(ctl.Width, lngHeight), L_Color, BF
End Select
Next ctl
End With
On Error GoTo 0
Exit Sub
DrawTableInDetailSectionStep_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Obrisovka of Module MdlReportFunctions"
End Sub
|