开发者

mdiparent click

开发者 https://www.devze.com 2023-01-15 17:31 出处:网络
The click ,double click on mdi parent of the .net MDI form does not work is it a b开发者_运维技巧ug?Well, that\'s not much to go on without knowing exactly what you click on.The gray background of the

The click ,double click on mdi parent of the .net MDI form does not work is it a b开发者_运维技巧ug?


Well, that's not much to go on without knowing exactly what you click on. The gray background of the parent is a separate control, an MdiClient, not the form. You'd register a click event for it with code like this:

    public Form1() {
        InitializeComponent();
        foreach (var ctl in this.Controls) {
            if (ctl is MdiClient) {
                (ctl as MdiClient).Click += Client_Click;
                break;
            }
        }
    }
    private void Client_Click(object sender, EventArgs e) {
        // etc...
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号