Dim M_Col As LongPrivate Sub Form_Load() Text1.Visible = False End SubPrivate Sub MSHFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) With MSHFlexGrid1 M_Col = .MouseCol Text1.Visible = False Text1.Move .Left + .CellLeft, .Top + .CellTop, .CellWidth, .CellHeight Text1.Text = .Text Text1.Visible = True Text1.SetFocus End With End SubPrivate Sub Text1_Change() Dim OleWidth As Long Dim NewWidth As Long
With MSHFlexGrid1 .Text = Text1.Text OleWidth = Text1.Width NewWidth = TextWidth(Text1.Text) If NewWidth > OleWidth Then .ColWidth(M_Col) = NewWidth Text1.Width = NewWidth End If End With End Sub
Dim M_Col As LongPrivate Sub Form_Load()
Text1.Visible = False
End SubPrivate Sub MSHFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
With MSHFlexGrid1
M_Col = .MouseCol
Text1.Visible = False
Text1.Move .Left + .CellLeft, .Top + .CellTop, .CellWidth, .CellHeight
Text1.Text = .Text
Text1.Visible = True
Text1.SetFocus
End With
End SubPrivate Sub Text1_Change()
Dim OleWidth As Long
Dim NewWidth As Long
With MSHFlexGrid1
.Text = Text1.Text
OleWidth = Text1.Width
NewWidth = TextWidth(Text1.Text)
If NewWidth > OleWidth Then
.ColWidth(M_Col) = NewWidth
Text1.Width = NewWidth
End If
End With
End Sub