Chris Davis wrote on 2015-02-27: > Is there a "nice easy" way of ensuring that whatever value I assign to a textbox (and/or label) autofit's, a bit like you can do with a cell in excel. > > Thanks > > Chris. > Chris,
With labels you have the AutoSize property you can set to True. With textboxes, there is no setting. Grids in VFP 9 (maybe 8) have an AutoFit method on the Column. There is a caveat with this, it only autofits what is currently visible in the grid. If you have a column that is showing 5 rows and each row only has 4 characters, then the 6th row has 10 characters, the autofit will shrink the column to show the 4 characters, cutting of the 10 characters when you scroll up. You may be able to find, or write, a builder for the design time to auto size your textboxes. You may also be able to code your base class to use ThisForm.TextHeight and ThisForm.TextWidth methods. However, using this during instantiation/resize, you could overlap another object on the form. I felt it was better to use those methods in the designer, as part of a builder. HTH, Tracy Tracy Pearson PowerChurch Software _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

