请问  你的text 是不是多行的?

解决方案 »

  1.   

    我的text不是多行的(对dxj221说)
      

  2.   

    你的text控件的最大输入长度是不是设为1了阿
      

  3.   

    我没设置,它自动默认为0,(对haptears说)
      

  4.   


    Private Sub FlexKj_Click()
      If txtEdit.Visible Then Exit Sub
      txtEdit.Move FlexKj.CellLeft + FlexKj.Left, FlexKj.CellTop + flexKj.Top,
    FlexKj.CellWidth, FlexKj.CellHeight
            txtEdit.Visible = True
            txtEdit.SetFocus
            txtEdit = FlexKj.TextMatrix(FlexKj.Row, FlexKj.Col)
        End If
    End SubPrivate Sub FlexKj_KeyPress(KeyAscii As Integer)
            Select Case KeyAscii
                Case 0 To 32
                    txtEdit.Text = FlexKj.Text
                    txtEdit.SelStart = Len(txtEdit) + 1
                Case Else
                    txtEdit.Text = FlexKj.Text & Chr(KeyAscii)
                    txtEdit.SelStart = Len(txtEdit) + 1
            End Select
            txtEdit.Move FlexKj.CellLeft + FlexKj.Left, FlexKj.CellTop + FlexKj.Top, FlexKj.CellWidth, FlexKj.CellHeight
            txtEdit.Visible = True
            txtEdit.SetFocus
    End SubPrivate Sub FlexKj_LeaveCell()
        If Not txtEdit.Visible Then
            Exit Sub
        End If
        FlexKj.Text = txtEdit
        txtEdit.Visible = False
        txtEdit = ""
    End Sub