VB projects - Adjust flexgrid cell width
Description: Adjust flexgrid cell to text width
Minimum requirements: VB6
Download: source code
Screenshot:

Project: EXE
Controls: CommandButton cmdEnter, TextBox txt, MSFlexGrid grd, Label lbl (AutoSize = -1 'True)
Additional references: none
Code:
Option Explicit
Private Sub cmdEnter_Click()
grd.Text = txt
lbl.FontName = grd.CellFontName
lbl.FontSize = grd.CellFontSize
lbl = grd.Text
grd.ColWidth(grd.Col) = lbl.Width + 120
End Sub
|