B
BillE
When I create a control dynamically and it grows according to the content,
the control Height property still returns the original default control
height instead of the height after expanding.
How can I get the height of the control (in code) after it grows?
I am building a windows form dynamically, creating controls and placing them
on the form. There can be dozens of controls of all types on the form.
This is for dynamic questionnaires.
The controls can grow, depending on the content. For example, a label
control can expand in height if the content is lengthy.
I am placing the controls on the form by setting the location to a point,
using a Y Position variable that increments with each control by adding the
height of the control to the previous Y position.
However, it seems that if a control expands in height, the Height property
still contains the original height, and so the next control is not placed
low enough on the form.
What is the best way to determine the placement of the controls?
I tried dynamically building a table using the TableLayoutPanel, which
worked fine but the performance was terrible, so I abandoned that approach.
thanks
Bill
the control Height property still returns the original default control
height instead of the height after expanding.
How can I get the height of the control (in code) after it grows?
I am building a windows form dynamically, creating controls and placing them
on the form. There can be dozens of controls of all types on the form.
This is for dynamic questionnaires.
The controls can grow, depending on the content. For example, a label
control can expand in height if the content is lengthy.
I am placing the controls on the form by setting the location to a point,
using a Y Position variable that increments with each control by adding the
height of the control to the previous Y position.
However, it seems that if a control expands in height, the Height property
still contains the original height, and so the next control is not placed
low enough on the form.
What is the best way to determine the placement of the controls?
I tried dynamically building a table using the TableLayoutPanel, which
worked fine but the performance was terrible, so I abandoned that approach.
thanks
Bill