The click ,double click on mdi parent of the .net MDI form does not work is it a bug?
+1
A:
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...
}
Hans Passant
2010-09-13 12:39:12
Great answer Thanks, but quite surprising that I could not find it any where else,It also solves by another question as listed in http://stackoverflow.com/questions/3698445/problem-with-controls-in-mdi-form/3706206#3706206
Thunder
2010-09-14 04:54:19