mdiparent click

我与影子孤独终老i 提交于 2019-12-24 20:17:58

问题


The click ,double click on mdi parent of the .net MDI form does not work is it a bug?


回答1:


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...
    }


来源:https://stackoverflow.com/questions/3699098/mdiparent-click

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!