Private Sub sGyouInsert() Dim intGyouNo As Integer intGyouNo = fpSpread1.ActiveRow With fpSpread1 Select Case 0 Case 0: ' 1行 .BlockMode = False .InsertRows intGyouNo, 1 End Select End WithEnd Sub ‘这一段实在spd当前行上面加一行 要想在下面加一行就像楼上说的那样.maxrow = .maxrow +1就行你要实在想开始的时候spd里什么都没有,那就.maxrow=0,在spd gotfocus的时候,判断一下, 当.maxrow = 0时 就.maxrow = 1 否则什么也不做
Private Sub Form_Load() With spd .MaxCols = 1 .MaxRows = 1 End With End SubPrivate Sub spd_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then spd.MaxRows = spd.MaxRows + 1 End If End Sub
Private Sub fpSpread1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then 'Enterキーが押された場合 fpSpread1.MaxRows = fpSpread1.MaxRows + 1 end if end sub
//你这个想法就是错的,起码一开始你的 .MaxRows 最少要等于1输入后又如何按ENTER增加一行继续输入啊
//你最好的操作是设置一个command在这里写上 .maxrows=.maxrows+1而不是一个个格式的去读
With fpSpread1
Select Case 0
Case 0: ' 1行
.BlockMode = False
.InsertRows intGyouNo, 1
End Select End WithEnd Sub
‘这一段实在spd当前行上面加一行
要想在下面加一行就像楼上说的那样.maxrow = .maxrow +1就行你要实在想开始的时候spd里什么都没有,那就.maxrow=0,在spd gotfocus的时候,判断一下,
当.maxrow = 0时 就.maxrow = 1 否则什么也不做
好像不行,我刚才说的“你要实在想开始的时候spd里什么都没有,那就.maxrow=0,在spd gotfocus的时候,判断一下,
当.maxrow = 0时 就.maxrow = 1 否则什么也不做“不行
With spd
.MaxCols = 1
.MaxRows = 1
End With
End SubPrivate Sub spd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
spd.MaxRows = spd.MaxRows + 1
End If
End Sub
Private Sub fpSpread1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then 'Enterキーが押された場合
fpSpread1.MaxRows = fpSpread1.MaxRows + 1
end if
end sub