reportactivereports

Active Reports 7 Make texboxes resize together


How can I make textboxes resize together when one of them word wraps. I am using borders and I need to texboxes to be the same size so the borders line up correctly. Im using Active Reports 7 and have a sub report that contains several textbox controls aligned beside each other horizontally. Like so.

[Textbox1    ][Textbox2    ][Textbox3    ][Textbox4    ]

When textbox1 word wraps I end up with something like this

[Textbox1....][Textbox2    ][Textbox3     ][Textbox4    ]
[..2nd line. ]  

Ive tried setting the textbox sizes in the format event but that doesnt work. Because the texboxes havent resized yet.

Private Sub Detail1_Format(sender As Object, e As EventArgs) Handles Detail1.Format
    'Resize all the texboxes so when the description WordWraps all the other texbox borders line up correctly.
TextBox1.Height = TextBox1.Height
TextBox2.Height = TextBox1.Height
TextBox3.Height = TextBox1.Height
TextBox4.Height = TextBox1.Height
TextBox5.Height = TextBox1.Height
TextBox6.Height = TextBox1.Height
End Sub

Solution

  • You will not get the correct results if you use the "Format" event to set the height of the other textboxes in accordance to the first textbox height. I would suggest you to rather use the "BeforePrint" event to set the height.

    public void Detail_BeforePrint()
    {
        this.TextBox2.Height = this.TextBox1.Height;    
        this.TextBox3.Height = this.TextBox1.Height;
    }
    

    Hope this helps.