R
R
Roman Musalimov2019-01-21 19:18:29
C++ / C#
Roman Musalimov, 2019-01-21 19:18:29

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.

Screenshots
5c45f07686907694294003.png5c45f0b247b09650096850.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-01-21
@byte916

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 question

Ask a Question

731 491 924 answers to any question