Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Resize the columns of a flexgrid
Author:
NBS Solutions
E-mail:
Click to e-mail author
Website:
http://www.netnet.ca/vbcode.htm
Submitted:
4/16/2004
Version:
VB6
Compatibility:
VB6
Category:
Controls
Views:
16441
Resize the columns of a flexgrid at runtime to fit the values to be displayed.
Declarations:
'none
Code:
Dim r As Integer Dim c As Integer Dim max_len As Single Dim new_len As Single Font.Name = msfCar.Font.Name Font.Size = msfCar.Font.Size For c = 0 To msfCar.Cols - 1 max_len = 0 For r = 0 To msfCar.Rows - 1 new_len = TextWidth(msfCar.TextMatrix(r, c)) If max_len < new_len Then max_len = new_len Next r msfCar.ColWidth(c) = max_len + 240 msfCar.ColAlignment(c) = flexAlignLeftCenter Next c msfCar.AllowUserResizing = flexResizeBoth 'Note 'msfCar is a flexgrid control
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement