VSG1.FocusRect = flexFocusNone VSG1.Editable = flexEDNone 'SendKeys "{TAB}" Else VSG1.Editable = flexEDKbd SendKeys "{ENTER}" End If End Sub 或: Private Sub VSG1_RowColChange() If VSG1.Col = 1 Or VSG1.Col = 3 Then SendKeys "{RIGHT}" Else SendKeys "{ENTER}" End If End Sub 或: Private Sub VSG1_RowColChange() If VSG1.Col = 1 Or VSG1.Col = 3 Then VSG1.Editable = flexEDNone Else VSG1.Editable = flexEDKbd VSG1.EditCell '自动选择单元内容 VSG1.EditSelStart = 0[选到最前]1[选到指定]Len(VSG1.Text)[选到最后] End If End Sub ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ '对齐方式(-1标示所有) .ColAlignment(-1) = flexAlignLeftCenterflexAlignCenterCenterflexAlignRightCenter 示例1:(最后一行的第3列靠右对齐) VSG1.Select VSG1.Rows - 1, 2 VSG1.CellAlignment = flexAlignRightCenter 示例2: VSG1.Row = VSG1.Rows - 1: VSG1.Col = 1 VSG1.CellAlignment = flexAlignRightCenter 示例3: VSG1.Cell(flexcpAlignment, VSG1.Rows - 1, 1, VSG1.Rows - 1, 3) = flexAlignRightCenter ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 本对象拖放: Private Sub VSG1_MouseDown(Button As Integer, _ Shift As Integer, X As Single, Y As Single) VSG1.Drag VSG1.DragIcon = LoadPicture("D:\Icon.ico") VSG1.DragRow VSG1.RowSel End Sub 或从其它对象拖: Private Sub VSG2_MouseDown(Button As Integer, _ Shift As Integer, X As Single, Y As Single) VSG2.OLEDrag VSG1.OLEDropMode = flexOLEDropAutomatic End Sub ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Public Sub VSGridCount(Optional SelRow As Long, Optional SelCol As Long)