Ant*_*yrd 3 c# contextmenu visual-studio-2010 winforms
我想使用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;
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21518 次 |
| 最近记录: |