txtEdit.Visible = False
    
    txtEdit.Top = MSH.CellTop + MSH.Top
    txtEdit.Left = MSH.CellLeft + MSH.Left
    txtEdit.Height = MSH.CellHeight
    txtEdit.Width = MSH.CellWidth
    txtEdit.Visible = True
    
    txtEdit.SelStart = 0
    txtEdit.SelLength = Len(txtEdit.Text)
    txtEdit.SetFocus

解决方案 »

  1.   

    Private Sub MSFlexGrid1_Click()
        Dim c As Integer
        Dim r As Integer
        
        With MSFlexGrid1
            c = .Col
            r = .Row
            Text6.Left = MSFlexGrid1.Left + MSFlexGrid1.ColPos(c)
            Text6.Top = MSFlexGrid1.Top + MSFlexGrid1.RowPos(r)
            If .Appearance = 1 Then
                Text6.Left = Text6.Left + 2 * Screen.TwipsPerPixelX
                Text6.Top = Text6.Top + 2 * Screen.TwipsPerPixelY
            End If
            Text6.Width = .ColWidth(c)
            Text6.Height = .RowHeight(r)
            Text6.Text = .Text
        End With
        Text6.Visible = True
        Text6.SetFocus
    End Sub
    Private Sub MSFlexGrid1_Scroll()
        Text6.Visible = False
    End Sub
    Private Sub Text6_Change()
        MSFlexGrid1.Text = Text6.Text
    End SubPrivate Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
        If KeyCode = vbKeyReturn Then
            Text6.Visible = False
        End If
    End SubPrivate Sub Text6_LostFocus()
        Text6.Visible = False
    End Sub