2010-06-17 25 views

回答

1

据我所知,contextMenuStrips没有“位置”字段。甲位置被设置一旦它示出像这样:

Dim thePoint As Point = (New System.Drawing.Point(someXValue, someYValue)) 
ContextMenuStrip1.Show(PictureBox1.PointToScreen(thePoint)) 

上述代码建立一个点,并且如被示出的的ContextMenuStrip,其分配的位置向右然后。如果您想要在调用show()后检索contextMenuStrip的位置,则可以投射对象并像这样检索位置

MessageBox.Show(DirectCast(ContextMenuStrip1, ToolStrip).Location.Y)