积极答复者
网格光标右移动with goto 语句出错,请feiyun0112帮忙看一下

问题
-
Public Sub right_move(ByVal ugrid As Infragistics.Win.UltraWinGrid.UltraGrid, ByVal colindex As Integer, ByVal rowindex As Integer, Optional ByVal parentrow As Infragistics.Win.UltraWinGrid.UltraGridRow = Nothing, Optional ByVal bnum As Integer = 0)
ugrid.Selected.Cells.Clear()
ugrid.Selected.Rows.Clear()
ugrid.Selected.Columns.Clear()
colindex += 1
If colindex <= ugrid.DisplayLayout.Bands(bnum).Columns.Count - 1 Then
Dim conum As Integer = 1
While ugrid.DisplayLayout.Bands(bnum).Columns(colindex).Hidden = True OrElse ugrid.DisplayLayout.Bands(bnum).Columns(colindex).CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit OrElse ugrid.DisplayLayout.Bands(bnum).Columns(colindex).CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled OrElse ugrid.DisplayLayout.Bands(bnum).Columns(colindex).CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect OrElse ugrid.DisplayLayout.Bands(bnum).Columns(colindex).CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect
If ugrid.DisplayLayout.Bands(bnum).Columns(colindex).Hidden = False Then
conum += 1
End If
colindex += 1
If colindex > ugrid.DisplayLayout.Bands(bnum).Columns.Count - 1 Then
colindex = 1
GoTo A '''未定义标签A
End If
End WhileIf ugrid.DisplayLayout.Bands(bnum).CardView = True Then
ugrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextCellByTab, True, True)
Else
If (rowindex > ugrid.Rows.Count - 1 OrElse (ugrid.Rows.Count - 1 < 0 AndAlso rowindex <= 0)) Then
If conum > 1 Then
SendKeys.Send("{TAB" & conum & "}")
Else
SendKeys.Send("{TAB}")
End If
SendKeys.Send("{F4}")
Else
If parentrow Is Nothing Then
If ugrid.Rows(rowindex).Cells(colindex).Hidden = True Then
right_move(ugrid, colindex, rowindex, parentrow, bnum)End If
ugrid.Rows(rowindex).Cells(colindex).Activated = True
ugrid.Rows(rowindex).Cells(colindex).Selected = True
Else
If rowindex > parentrow.ChildBands(0).Rows.Count - 1 OrElse rowindex <= 0 Then
If conum > 1 Then
SendKeys.Send("{TAB" & conum & "}")
Else
SendKeys.Send("{TAB}")
End If
SendKeys.Send("{F4}")
Exit Sub
Else
If parentrow.ChildBands(0).Rows(rowindex).Cells(colindex).Hidden = True Thenright_move(ugrid, colindex, rowindex, parentrow, bnum)
End If
parentrow.ChildBands(0).Rows(rowindex).Cells(colindex).Activated = True
parentrow.ChildBands(0).Rows(rowindex).Cells(colindex).Selected = True
End If
End If
ugrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, True, True)
ugrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ToggleDropdown, True, True)
End If
End If
Else
colindex = -1
rowindex += 1
If ugrid.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No Then
If parentrow Is Nothing Then
If rowindex > ugrid.Rows.Count - 1 Then
rowindex = ugrid.Rows.Count - 1
Else
If rowindex > parentrow.ChildBands(0).Rows.Count - 1 Then
rowindex = parentrow.ChildBands(0).Rows.Count - 1
End IfIf parentrow Is Nothing Then
If rowindex > ugrid.Rows.Count Then
rowindex = ugrid.Rows.Count
Else
If rowindex > parentrow.ChildBands(0).Rows.Count Then
rowindex = parentrow.ChildBands(0).Rows.Count
End If
End If
If ugrid.DisplayLayout.Bands(bnum).CardView = True Then
If parentrow Is Nothing Then
ugrid.Rows(rowindex).IsCardCompressed = False
ugrid.Rows(rowindex).Activated = True
ugrid.Rows(rowindex).Selected = True
Else
parentrow.ChildBands(0).Rows(rowindex).IsCardCompressed = False
parentrow.ChildBands(0).Rows(rowindex).Activated = True
parentrow.ChildBands(0).Rows(rowindex).Selected = True
End If
End If
right_move(ugrid, colindex, rowindex, parentrow)
End If
End If
End If
End IfEnd If
End SubGoTo A '''未定义标签A
如果要定义 A 该如何定义啊??