FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Capturing the width of a xBrowse Column
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Capturing the width of a xBrowse Column
Posted: Mon Feb 13, 2012 03:16 PM

To All

I have been asked if a user stretches an xBrowse column to be able to capture the width of that column and then restore the with of that column when the user returns.

Is there a way to know what the widths of each xBrowse column is at close ? .. then be able to restore the custom changes a user makes to restore their preference ?

Thanks
Rick Lipkin

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Capturing the width of a xBrowse Column
Posted: Mon Feb 13, 2012 04:18 PM
Rick a sample :

Returns a Array of Column-width :
Code (fw): Select all Collapse
// a array to save the Column-width of all Columns
//---------------------------------------------------------
private aColW[LEN( oBrw:aCols )]
i := 1
FOR i := 1 TO LEN( oBrw:aCols )
   WITH OBJECT oBrw:aCols[i]
      aColW[i] := oBrw:aCols[i]:nWidth
   END
   msgalert( aColW[i], "Column : " + ltrim(str(i)) )
NEXT


Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Capturing the width of a xBrowse Column
Posted: Mon Feb 13, 2012 05:18 PM

Uwe

Thank you !

Rick

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Capturing the width of a xBrowse Column
Posted: Mon Feb 20, 2012 06:32 AM

Much easier way (may not be in very old versions)

oBrw:nWidths --> Array of widths of all columns

oBrw:nWidthds := { <w1>, <w2>, ...<wN> } sets widths of each column

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion