VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Resize the columns of a flexgrid contol at runtime to adjust to the values

by NBS Solutions (5 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 16th April 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Resize the columns of a flexgrid contol at runtime to adjust to the values

Rate Resize the columns of a flexgrid contol at runtime to adjust to the values



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

Download this snippet    Add to My Saved Code

Resize the columns of a flexgrid contol at runtime to adjust to the values Comments

No comments have been posted about Resize the columns of a flexgrid contol at runtime to adjust to the values. Why not be the first to post a comment about Resize the columns of a flexgrid contol at runtime to adjust to the values.

Post your comment

Subject:
Message:
0/1000 characters