Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Automatically resize a column to fit the width of the longest text under that column

 
Subscribe to the RSS feed for this forum  Forum Index -> FileView ActiveX Control
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Tue Apr 21, 2009 12:14 pm    Post subject: HOWTO: Automatically resize a column to fit the width of the longest text under that column

The following code automatically resizes a column to fit the width of the longest text under that column:

[C++]
Code:
m_fileVw.SetColumnWidth(_T(""),0,-1); // Autosize the column at index '0'
or
m_fileVw.SetColumnWidth(_T("Name"),0,-1); // Autosize the 'Name' column

[VB6]
Code:
fileVw.SetColumnWidth "", 0, -1 ' Autosize the column at index '0'
or
fileVw.SetColumnWidth "Name", 0, -1 ' Autosize the 'Name' column


Note
To make the last column expand to fit the FileView width, use the following code:
[C++]
Code:
// Expand width of last column to fit FileView width
m_fileVw.SetColumnWidth(_T(""),m_fileVw.GetColumnCount()-1,-2);

[VB6]
Code:
'Expand width of last column to fit FileView width
fileVw.SetColumnWidth "", fileVw.ColumnCount - 1, -2
Back to top
Display posts from previous:   
Forum Index -> FileView ActiveX Control All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group