Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resizing Text Boxes

Status
Not open for further replies.

Kicker

Technical User
Oct 15, 2000
14
0
0
US
I have several text boxes set to CanGrow/CanShrink in a report. I want to be able to resize all text boxes at runtime to be the same size as the largest text box.

Any ideas on how to accomplish
 
You need to find the tallest text box during the On Print event of the section. Then use this height to draw rectangles using the Me.Line method. The following is code from a calendar type report that has 5 subreports named srpt1 - srpt5 (Monday - Friday).
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Dim lngHeight As Long 'store the height of tallest control
    Dim i As Integer
    Dim lngLeft As Long
    For i = 1 To 5
        'compare heights
        If Me("srpt" & i).Height > lngHeight Then
            lngHeight = Me("srpt" & i).Height
        End If
    Next
    'add the height of other control
    lngHeight = lngHeight + Me.txtDay1.Height
    'draw the lines
    For i = 0 To 5
        lngLeft = i * Me.srpt1.Width
        Me.Line (lngLeft, 0)-(lngLeft, lngHeight)
    Next
End Sub


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top