0
我的表單有一個鏈接標籤llInventory和ContextMenuStrip cmsInventory。當我在鏈接標籤上點擊時,上下文菜單欄應該在鏈接標籤的正下方打開。所以我寫的代碼來定位的ContextMenuStrip,但它仍然顯示它在屏幕的左上角,這裏是代碼如何在鏈接標籤下放置ContextMenuStrip?
private void llInventory_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
// llInventory.BackColor = Color.Blue;
//llInventory.ForeColor = Control.
Point p = new Point(this.llInventory.Location.X, this.llInventory.Location.Y + llInventory.Height);
cmsInventory.PointToScreen(p);
cmsInventory.Show();
}
}
我該如何解決這個問題?
show(control,point)works !!! –