关于 .net:mdiparent 点击 | 珊瑚贝

mdiparent click


.net MDI 表单的 mdi 父级的单击、双击不起作用是错误吗?


好吧,如果您不知道您点击的是什么,那就没什么好做的了。父级的灰色背景是一个单独的控件,一个 MdiClient,而不是窗体。您可以使用如下代码为它注册一个点击事件:

1
2
3
4
5
6
7
8
9
10
11
12
    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…
    }
  • 很好的答案谢谢,但令人惊讶的是我在其他任何地方都找不到它,它还可以通过stackoverflow.com/questions/3698445/中列出的另一个问题来解决


来源:https://www.codenong.com/3699098/

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_9077.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?