Wpf 在顶点单击时获取顶点值
我已通过添加顶点双击事件Wpf 在顶点单击时获取顶点值,wpf,vb.net,graph-sharp,Wpf,Vb.net,Graph Sharp,我已通过添加顶点双击事件 For Each v In GraphSimple1.graphlayout.Children If TypeOf v Is VertexControl Then AddHandler TryCast(v, VertexControl).MouseDoubleClick, AddressOf v_MouseDoubleClick End If Next v 它工作得很好,但我如何才能得到我点击的顶点值 Private Sub v_
For Each v In GraphSimple1.graphlayout.Children
If TypeOf v Is VertexControl Then
AddHandler TryCast(v, VertexControl).MouseDoubleClick, AddressOf v_MouseDoubleClick
End If
Next v
它工作得很好,但我如何才能得到我点击的顶点值
Private Sub v_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
MessageBox.Show(Directcast(sender , VertexControl).ID)
End Sub
发送方是您的VertexControl,因此需要将其强制转换为类型VertexControl并可以使用它。在“v_MouseDoubleClick”@David Sdot中发生了什么?我刚刚在消息框中显示了顶点值,但我想在该字段中显示顶点值