lehongduc > 29-09-19, 05:14 PM
expression.Line (Step (x1, y1) - Step (x2, y2), Color, BF)
im ctl As Control, ctlName As String
Dim lngMaxHeight As Long 'Chieu cao nhat cua cac o du lieu
Dim intCtrl As Long, K As Long
Dim ArrayCtl(50) As String
intCtrl = 0
' Duyet qua tung o du lieu de lay chieu cao nhat (lngMaxHeight)
For Each ctl In Me.Controls
ctlName = ctl.Name
If Me.Controls(ctlName).Section = 0 And Me.Controls(ctlName).ControlType = acTextBox Then
If Me.Controls(ctlName).Height > lngMaxHeight Then
lngMaxHeight = Me.Controls(ctlName).Height
End If
intCtrl = intCtrl + 1
ArrayCtl(intCtrl) = ctlName
End If
Next ctl
'Ve khung bao voi chieu cao lngHeight da xac dinh o tren
For K = 1 To intCtrl
ctlName = ArrayCtl(K)
Set ctl = Me.Controls(ctlName)
Me.Line (ctl.Left, ctl.Top)-Step(ctl.Width, lngMaxHeight), , B
Next
Set ctl = Nothing