0
我有一个列表视图的VB应用程序。 我测试并结束了与此子我dragover事件:为什么Windows.Media.VisualTreeHelper.GetChild(...)退出子?
Private Sub ListView1_DragOver(sender As Object, e As DragEventArgs) Handles ListView1.DragOver
XToolStripLabel.Text = "X:" & e.X
YToolStripLabel.Text = "Y:" & e.Y
Dim Insertion As Integer = GetInsertion(MousePosition, ListView1)
SelectionTestTSlabel.Text = "SEL " & Insertion
If CurrentlyDragging Then
Dim gr As Graphics = ListView1.CreateGraphics
Windows.Media.VisualTreeHelper.GetChild(New Windows.DependencyObject(), 0) 'I know this seems like it doesn't do much
MsgBox("") 'I actually added this later because the rest of the code did not run normally.
Dim InsertionY As Integer = 24 + (Insertion * TestItemHeight)
If MyLastInsPoint = Insertion Then
Else
ListView1.Refresh()
gr.DrawLine(New Pen(Color.Gray, 3), New Point(0, InsertionY), New Point(ListView1.Width, InsertionY))
End If
MyLastInsPoint = Insertion
End If
End Sub
我意识到MSGBOX(“”)不弹出一个消息框,然后我的垃圾邮件对整个子断点。
子跑了作为正常的,但该行后,
Windows.Media.VisualTreeHelper.GetChild(New Windows.DependencyObject(), 0)
程序返回的形式,并没有执行MSGBOX(“”)线路。
这条线有什么问题?该程序甚至没有停在End Sub断点处。