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!

Set the Width of the Form 1

Status
Not open for further replies.

FoxProProgrammer

Programmer
Apr 26, 2002
967
US
My form has controls on the left and right side. When a specific option button is selected, the controls on the right side are hidden and I want to resize the window to eliminate the empty space. I tried Form.WindowWidth and Form.Width but neither work. The former returns an error ...can't set the property... and the latter is ignored - no change to the size of the window and no error. Any suggestions?

Thanks,


dz
 
Thank you so much, Remou. That did the job. I made the Border Style Dialog and deleted the code that hid the controls. That code wasn't needed because the user can't get to the controls when the window is resized. I have to wonder what Form.Width does - it seems like it should have worked as well.

Best wishes,

dz
 
I played with these things a while back trying to do what you're doing and like you, never got them to work for setting the widths, despite the fact that 2000/2003 Help states that you can. What they do in 2003 (and I think it was the same in 2000) is return the widths as currently set. Form.Width returns the Width as set in the Properties sheet for the form. Form.WindowWidth returns the actual width at the time you query it.

In other words, if the form's width is set to 5" in Properties, Form.Width will always return 7200(5*1440) no matter how the form is resized in Form View.

But Form.WindowWidth returns the actual width, so if you check it when this form first opens, it'll return 7200. If you then grab the border and resize it to 10" then Form.WindowWidth will return 14400 or 10*1440.

Help is either simply wrong (now that would be a surprise!) or maybe in ACC95 or ACC97 these could be set, and when that changed nobody bothered to update Help.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Some of these things can only be changed in design view.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top