表格应用中的制表系统 [英] tabbing system in form app
本文介绍了表格应用中的制表系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好朋友....我创建了一个类似notepad ++的应用程序,并且在保存文档时遇到了困难..我无法保存在表单关闭时在选项卡中创建或打开的每个文档. ..
请尽快给我帮助.
谢谢..
Hello friends.... i have created a application like notepad++ and i am facing difficulties to save the document.. i am not able to save each and every document which is created or opened in tabs at closing event of form...
pls get me help asap..
thanks..
推荐答案
假定您将它们作为文档包含在TabControl内的单独TabPage对象中,那么您要做的就是遍历页面并调用Save方法在每一个上:
Assuming you have them as a document inside separate TabPage objects within a TabControl, all you have to do is loop through the pages and call your Save method on each of them:
foreach (TabPage page in MyTabs.TabPages)
{
foreach (Control c in page.Controls)
{
MyDocument md = page.Controls[0] as MyDocument;
if (md != null)
{
md.Save();
break;
}
}
}
外部循环检查每个TabPage,内部循环在Page中查找文档并将其保存.
The outer loop examines each TabPage, the inner loop finds the document within the Page and saves it.
这篇关于表格应用中的制表系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文