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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autosizing on the fly

Status
Not open for further replies.

eveCalypso

Programmer
Apr 29, 2003
134
GB
Hello All,
I hope you can help me!

I am building a form on the fly with many checkbox options from an array.
Everything works except...
being on the fly, I need to resize my form and frame as needed when I am done, to do this I need the width of the longest chexkbox in the current group.

I assumed that doing myNewCtrl.Autosize would resize the control to the correct caption width, but alas...
when I display the width of the checkbox directly afterwards, it displays (in my case) 57 for all of them (never enough!). If I comment the Autosize line out,
it at least stays with the default create dimension width of 108.

I could conceivably keep track of the longest caption myself and multiply the result by some factor, but that is not the preffered way! I can not guarentee that result.

Does anyone know why Autosize is not taking "effect"? I create the control as visible. Also, I start of with a maximum sized form and frame... do I need to repaint/refresh anything?
I am using VBA for Office 2000 (in Word).

ANY help would be appreciated!
Best Regards,
EvE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top