回复 6楼x_g的帖子
如下代码,可以帮你解决上下键移动的问题:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
GcMultiRow1.Template = Template.CreateGridTemplate(3)
GcMultiRow1.RowCount = 5
GcMultiRow1.EditMode = EditMode.EditOnEnter
GcMultiRow1.ShortcutKeyManager.Unregister(Keys.Down Or Keys.Control)
GcMultiRow1.ShortcutKeyManager.Unregister(Keys.Up Or Keys.Control)
GcMultiRow1.ShortcutKeyManager.Unregister(Keys.Left Or Keys.Control)
GcMultiRow1.ShortcutKeyManager.Unregister(Keys.Right Or Keys.Control)
End Sub
Private Sub GcMultiRow1_EditingControlShowing(ByVal sender As Object, ByVal e As GrapeCity.Win.MultiRow.EditingControlShowingEventArgs) Handles GcMultiRow1.EditingControlShowing
RemoveHandler e.Control.KeyDown, AddressOf editor_KeyDown
AddHandler e.Control.KeyDown, AddressOf editor_KeyDown
End Sub
Private Sub editor_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
If e.Control Then
Select Case e.KeyCode
Case Keys.Down
e.SuppressKeyPress = True
SelectionActions.MoveDown.Execute(DirectCast(sender, IEditingControl).GcMultiRow)
Case Keys.Up
e.SuppressKeyPress = True
SelectionActions.MoveUp.Execute(DirectCast(sender, IEditingControl).GcMultiRow)
Case Keys.Left
e.SuppressKeyPress = True
SelectionActions.MoveLeft.Execute(DirectCast(sender, IEditingControl).GcMultiRow)
Case Keys.Right
e.SuppressKeyPress = True
SelectionActions.MoveRight.Execute(DirectCast(sender, IEditingControl).GcMultiRow)
End Select
End If
End Sub
如不能解决你的问题,欢迎你继续反馈,给您带来的
不便深感抱歉!!! |