1、在设计模式里打开该报表,把要加左竖线、右竖线的TextBox的Tag属性都改成left,把要同时加左右竖线的TextBox的Tag属性改成l__R。 Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) Dim a As Control For Each a In Me.Controls If a.ControlType = acTextBox And a.Tag = "left" Then Me.Line (a.Left, 0)-(a.Left, a.Height) ElseIf a.ControlType = acTextBox And a.Tag = "L__R" Then Me.Line (a.Left, 0)-(a.Left, a.Height) Me.Line (a.Left + a.Width, 0)-(a.Left + a.Width, a.Height) End If Next End Sub 4、预览报表就可以看到报表上每个文本框左右都有一条竖线,这竖线可是会随TextBox的左右、大小变化而自动修正变化的。
|
录入:changechange(CSDN) 责任编辑:cg1