Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 在顶点单击时获取顶点值_Wpf_Vb.net_Graph Sharp - Fatal编程技术网

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中发生了什么?我刚刚在消息框中显示了顶点值,但我想在该字段中显示顶点值