Resizing a control when the Form is resized 
Author Message
 Resizing a control when the Form is resized

Hi all...

I have some controls on a form. Inside the form I have a container control
called spMain, and inside that container control, I have other controls.

spMain is resized correctly when the Form is resized, due to how that
control was programmed internally, but, that spMain control contains other
controls, for example, a Frame control, which I need to resize manually
proportionally to spMain dimensions.

I tried to use Form_Resize method, but apparently, that event is called
prior efectively resizing of the form, so the spMain control doesn't have
the new size yet and when I calculate the new size of the Frame control, I'm
using the old spMain size instead of the new one.

How can I do it?

Thanks
Jaime



Mon, 17 Jan 2005 04:28:13 GMT  
 Resizing a control when the Form is resized
About the only thing I can suggest is... since Paint always fires after
Resize, place your Resize code there.. you'll probably want to set a flag in
the Resize event that your Paint code tests and clears after use so the
control sizing doesn't take place every time Paint fires (which can be quite
often)

--
Ken Halter - MS-MVP-VB - Please keep it in the groups..
http://www.vbsight.com/ - http://www.vbsight.com/MultiColumn.htm

Quote:

> Hi all...

> I have some controls on a form. Inside the form I have a container
> control called spMain, and inside that container control, I have
> other controls.

> spMain is resized correctly when the Form is resized, due to how that
> control was programmed internally, but, that spMain control contains
> other controls, for example, a Frame control, which I need to resize
> manually proportionally to spMain dimensions.

> I tried to use Form_Resize method, but apparently, that event is
> called prior efectively resizing of the form, so the spMain control
> doesn't have the new size yet and when I calculate the new size of
> the Frame control, I'm using the old spMain size instead of the new
> one.

> How can I do it?

> Thanks
> Jaime



Mon, 17 Jan 2005 12:04:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. resizing a form when a control resizes during execution

2. Resize form - resize controls

3. Correction: Resize form - resize controls

4. resizing a form when a control resizes during execution

5. Resizing all controls at form resize

6. Dynamically move/resize controls on resized form

7. Resize, resize, resize, ...

8. Resizing Everything when Form Resizes

9. Resizing an object when a form is resized.....

10. Resizing components after form resize

11. resizing DataGrid after resizing Form

12. Resizing objects when form gets resized

 

 
Powered by phpBB® Forum Software