Resize Textbox Controls At Runtime!

S

Stew Hayles

Hello everybody,

I have three textbox controls in the detail section of my report. They are
fed data through a query that changes the data displayed depending on
criteria I have set. I want to make the height of the text boxes the same so
that the formatting of the report is kept nice and tidy. To do this I have
tried to resize the controls in both the On Page event and On Print event.
With the On Page event I was unable to get the size because the data had not
loaded into the fields yet so they were all set at 0 and with the On Print
event it returned an error stating that the formatting of controls could not
be done after printing had taken place (something to that effect anyway).

I then thought that what I would do is draw rectangles on the report using
the line function. This started off ok but I can not get the rectangles to
align with the textbox controls correctly. I have entered the textbox top
and left values as the starting points for the rectangle and used the width
and height values to draw the rectangle but it appears on the report in
completely the wrong place and the size appears to be a lot bigger than I was
hoping for.

If anybody could help me with either of these two methods to make my
formatting look neater I would be very grateful as it is giving me a headache!

Regards,

Stewart Hayles
 
M

Marshall Barton

Stew said:
I have three textbox controls in the detail section of my report. They are
fed data through a query that changes the data displayed depending on
criteria I have set. I want to make the height of the text boxes the same so
that the formatting of the report is kept nice and tidy. To do this I have
tried to resize the controls in both the On Page event and On Print event.
With the On Page event I was unable to get the size because the data had not
loaded into the fields yet so they were all set at 0 and with the On Print
event it returned an error stating that the formatting of controls could not
be done after printing had taken place (something to that effect anyway).

I then thought that what I would do is draw rectangles on the report using
the line function. This started off ok but I can not get the rectangles to
align with the textbox controls correctly. I have entered the textbox top
and left values as the starting points for the rectangle and used the width
and height values to draw the rectangle but it appears on the report in
completely the wrong place and the size appears to be a lot bigger than I was
hoping for.


Drawing rectangles is the right idea. If you want the
rectangle to be the same height as the detail section, you
could use something like this in the detail section's Print
event:

Me.Line (txt1.Left, 0) - Step(txt1.Width,
Me.Section(0).Height), , B

But there are some tricky situation involved with this kind
of thing, so I suggest that you look at using the PrintLines
download at www.lebans.com
 
S

Stew Hayles

Ok Marshall I will take a look at this lebans.com.

Thanks a lot for your help.

Stewart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top