Answer the question
In order to leave comments, you need to log in
How to create a dialog box in C#?
Good day.
Can you please tell me how to create a dialog box in C#? I can not call this window, it is necessary that when you right-click on the tree, a dialog box with add / remove parameters is called. For example: click on the Organization, and select add>add a room, similarly with deletion.
Answer the question
In order to leave comments, you need to log in
Apparently, what you need is not a dialog box, but a context menu.
Add a click event to your tree like this (in the example, I used a label and not a tree, but this does not change the essence).
private void label1_Click(object sender, EventArgs e)
{
if ((e as MouseEventArgs)?.Button == MouseButtons.Right)
{
this.contextMenuStrip1.Show(label1, 0, 0);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question