MS标准例程(ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/vbcon/html/vbtskdeterminingactivemdichild.htm):
// Determine the active child form.
Form activeChild = this.ActiveMdiChild; // If there is an active child form, find the active control, which
// in this example should be a RichTextBox.
if (activeChild != null)
{
try
{
RichTextBox theBox = (RichTextBox)activeChild.ActiveControl;
if (theBox != null)
{
// Put the selected text on the Clipboard.
Clipboard.SetDataObject(theBox.SelectedText);
}
}
catch
{
MessageBox.Show("You need to select a RichTextBox.");
}
}
}
// Determine the active child form.
Form activeChild = this.ActiveMdiChild; // If there is an active child form, find the active control, which
// in this example should be a RichTextBox.
if (activeChild != null)
{
try
{
RichTextBox theBox = (RichTextBox)activeChild.ActiveControl;
if (theBox != null)
{
// Put the selected text on the Clipboard.
Clipboard.SetDataObject(theBox.SelectedText);
}
}
catch
{
MessageBox.Show("You need to select a RichTextBox.");
}
}
}
解决方案 »
- 如何将word中的表格复制到另外一个word文件中
- 请教C#生成重启windows的程序写法
- 【关于 WinForm 下 DataGridView 绑定List<T> 的问题】
- Excel对象最后能不能不保存而直接输出流到客户端?
- 在C#中,如何按了A按钮后,触发B按钮的动作呢?
- 做了个用户登录,按确定后就应该能打开数据库看到数据,怎么做?
- c#委托问题
- 如何获取对象的类型信息
- c#异步.客户端和服务器端都做完了.但发现客户机连不上服务器端.有空的或有这方面经验的.帮忙调试下说下原因.
- ???DataList里基模板和交替模板各有一个LinkButton,为什么触发ItemCommand事件时只有一个LinkButton能被实例化?
- 制作安装文件的时候总是出现“不可恢复的生成错误”——怎么办?
- 在c#中咋调用API函数?
Form.ActiveMdiChild只是返回一个MDI数组
怎么才能使一个未处于激活状态的MDI窗体,在发生某一事件之后,激活该窗体