J
Jongmin
Hi everybody,
My task is so simply but I can't.
1. click a menu in context menu
2. create new object such as button
3. set locaction of the object as left-top of contex menu
public System.Windows.Forms.ContextMenu ctxMenu;
private System.Windows.Forms.MenuItem mnuAdd;
..
..
private void mnuAdd_Click(object sender, System.EventArgs
e)
{
System.Windows.Forms.Button button1 = new Button();
// I want use the left-top point of context menu
button1.Location = new Point(120, 345);
button1.Name = "button1";
button1.TabIndex = 0;
button1.Text = "button1";
this.Controls.Add(button1);
}
Thanks,
Jongmin
My task is so simply but I can't.
1. click a menu in context menu
2. create new object such as button
3. set locaction of the object as left-top of contex menu
public System.Windows.Forms.ContextMenu ctxMenu;
private System.Windows.Forms.MenuItem mnuAdd;
..
..
private void mnuAdd_Click(object sender, System.EventArgs
e)
{
System.Windows.Forms.Button button1 = new Button();
// I want use the left-top point of context menu
button1.Location = new Point(120, 345);
button1.Name = "button1";
button1.TabIndex = 0;
button1.Text = "button1";
this.Controls.Add(button1);
}
Thanks,
Jongmin