我想用C#,将显示旁边类似于这里发生在Visual Studio中的节点,以创建上下文菜单:
我现在该代码使得主要形式闪烁。
private void treeView1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
var myForm = new Form {Text = "My Form"};
myForm.SetBounds(10, 10, 200, 200);
myForm.Show();
// Determine if the form is modal.
if (myForm.Modal == false)
{
// Change borderstyle and make it not a top level window.
myForm.FormBorderStyle = FormBorderStyle.FixedToolWindow;
myForm.TopLevel = false;
}
}
}