maidinhdan > 23-09-16, 05:11 PM
Private Sub Detail_Print(ByRef intCancel As Integer, ByRef intPrintCount As Integer)
Dim lm As Long
lm = Hamchieucaonhat(acDetail)
' Dien ten cot can can bang do cao o duoi day: txt1, txt2, txt3
Dieuchinhchieucao Me.txt1, lm, 0, 0, 0, 0, 0, vbRed
Dieuchinhchieucao Me.txt2, lm, 0, 0, 0, 0, 0, vbGreen
Dieuchinhchieucao Me.txt3, lm, 0, 0, 0, 0, 0, vbBlue
End Sub
Private Function Hamchieucaonhat(ByVal intSection As Integer) As Long
Dim lngHeight As Long
Dim ctlControl As Control
For Each ctlControl In Me.Section(intSection).Controls
If ctlControl.ControlType = acTextBox Then
If ctlControl.Height > lngHeight Then
lngHeight = ctlControl.Height
End If
End If
Next ctlControl
Hamchieucaonhat = lngHeight
End Function