Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OleControl in container - resize issue

Status
Not open for further replies.

SteveDingle

Programmer
Jul 26, 2004
254
GB
Heya All,

I finished typing the following question, and then had a thought, and found solution. Figured I would share in case anyone else ran into it. Solution is to put initial resize code in the oleControl INIT not the container.

** Orignal Message **
VFP 9 SP1

I have an activeX control in a container( doesn't matter which one). Basically using the container as wrapper for control.

I want the oleControl to be the same size as the container. So I put the following in the INIT of the container

this.olecontrol.height = this.height

Also set the Anchor property of both the olecontrol and the container to 15 ( as I want them both to resize with form)

To test I dropped container on form, increased size of the container and then ran form, oleControl stayed the same size. I checked to see what was happening using ...

DEBUGOUT this.olecontrol.height

... and the control was changing size. It was somehow being set to its original dimensions sometime prior to the form init finishing. I found that by changing the Anchor property to 0, the initial resize worked but of course other resising didn't. Tried turning Anchor on/off in various places. Didn't help.

Toodles,
Steve Dingle
D&S Business Solutions Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top