Hallgeir said:
I want to have a rectangle with rounded corners as a frame around some of
the controls in my report. Does anyone know if there is an easy way to do
this, or do I have to draw it in mspaint or simular and then insert it as a
picture file in my report.
You can use the Line and Circle methods in the Print event
of the section containing the controls. Kind of tedious
calculating the coordinates of all the end points, but
doable.
For example, let's say you have two text boxes, txt1 and
txt2, the same width and txt1 above txt2, and you want your
1/4 inch radius rounded corner rectangle around both of
them:
Const Pi As Double = 3.14159265
Const R As Long = 0.25 * 1440
Line (txt1.Left + R, txt1.Top)- _
(txt1.Left + txt1.Width - R, txt1.Top)
Line (txt1.Left, txt1.Top + R)- _
(txt1.Left, txt2.Top + txt2.Height - R)
Line (txt1.Left + txt1.Width, txt1.Top + R)- _
(txt1.Left + txt1.Width, txt2.Top + txt2.Height - R)
Line (txt1.Left + R, txt2.Top + txt2.Height)- _
(txt1.Left + txt1.Width - R, txt2.Top + txt2.Height)
Circle (txt1.Left + R, txt1.Top + R), R, , Pi / 2, Pi
Circle (txt1.Left + txt1.Width - R, _
txt1.Top + R), R, , 0, Pi / 2
Circle (txt1.Left + R, _
txt2.Top + txt2.Height - R), R, , Pi, 3 * Pi / 2
Circle (txt1.Left + txt1.Width - R, _
txt2.Top + txt2.Height - R), R, , 3 * Pi / 2, 0