Resize the columns of a flexgrid contol at runtime to adjust to the values
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
(1(1 Vote))
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
Resize the columns of a flexgrid contol at runtime to adjust to the values Comments
No comments yet — be the first to post one!
Post a Comment