Advertisement
4_2005-2006 Custom Controls/ Forms/ Menus #149865

EditFlexGrid

This code allows users to edit in a MSFlexGrid

AI

Tóm tắt bởi AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Mã nguồn
original-source
Private Sub MyFlexGrid_KeyPress(KeyAscii As Integer)
'Provides manual data entry capability to flexgrid
  With MyFlexGrid
    Select Case KeyAscii
      Case vbKeyReturn
        If .Col + 1 <= .Cols - 1 Then
          .Col = .Cols - 1
          ElseIf .Row + 1 <= .Rows - 1 Then
            .Row = .Row + 1
            .Col = 0
          Else
            .Row = 1
            .Col = 0
        End If
      Case vbKeyBack
        If Trim(.Text) <> "" Then
          .Text = Mid(.Text, 1, Len(.Text) - 1)
        End If
      Case Is < 32
        
      Case Else
        If .Col = 0 Or .Row = 0 Then
          Exit Sub
          Else
            .Text = .Text & Chr(KeyAscii)
        End If
          
    
    
    End Select
  
  
  End With
  
End Sub
Bình luận gốc (3)
Được khôi phục từ Wayback Machine