dynamically resizing forms

N

Nikhil Patel

Hi all,
I dynamically create new controls and display them on the form. My
problem is that the user has to resize form manually to see controls whose
location property points to a point outside the form's area. So can you
please show me a way to resize the form after adding a dynamic control so
whose Location points to a point outside the form's boundary. So that the
control can be displayed without resizing the form manually?

Thanks...
 
D

David Faircastle

Hi Nikhil,

Just as your Controls have a Size property, so does a Form. Simply
calculate the new width and height and set the Size.

Another approach is to set the AutoScroll property of the Form to
True. Then, when a Control appears which is outside the bounds of the
window, scroll bars will appear.

Regards,
Fergus
 

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

Similar Threads


Top