RE: Control margins used by grid AutoFit()

Author: Nancy Folsom

Posted: 2004-05-14 at 17:50:33

Hi, Malcolm-

> Thanks for the tip (re: use Textbox .Margin property) - it

> works - sort of - but I think it also uncovers an AutoFit()

> bug or two.

>

> 1. AutoFit() appears to ignore the .Margin setting and

> autosizes based on length of TextBox contents - not length of

> contents - .Margin * 2.

>

> 2. Cell highlighting within a cell with .Margin > 0 will only

> highlight the data entry area within the TextBox - not the

> entire cell.

I ran your sample. The ugliness you see in the selected cell is the margin,

not anything to do with autofit. I'd never noticed it before but then I

never had such an obvious margin. It's ugly, for sure.

I see what you mean about AutoFit not recognizing the margin setting. Items

are truncated. So, two things, I'd call the latter issue a bug (AutoFit

should account for margins). The issue of padding the columns a bit...It

would be nice if we could, say, pass a parameter to AutoFit that would set a

padding amount. At this point it would seem to be your best bet to autofit,

then go through and increment the columns by a bit--not a great solution,

but still easier than doing the whole calculation ourselves, I guess.

Let me know if you decide to post the bug and/or design change request. If

it's on the UT, I'll vote for it.

Regards-

Nancy Folsom

Pixel Dust Industries

Author _Debugging_Visual_FoxPro_Applications_

http://www.hentzenwerke.com/catalogpricelists/debugvfp.htm

©2004 Nancy Folsom