当我重新启动机器时,恢复最后加载的控件
我正在我的应用程序中的视频应用程序中工作,首先使用许多控件以方便用户使用,然后我将加载基础,然后我将根据用户需要加载其他控件......这里我的需要是如果用户加载十个控件在这种情况下,如果他关闭机器,意味着当他重新启动机器时,我需要将所有控件恢复到他在关闭之前加载控件的状态。预先感谢
是否有可能在不存储当前控制集和位置等的情况下实现这一目标。
I am working in video application in my application am using many controls for user friendly first i will Load the base from only after that i ll load the other controls based on user need.... here my need is if user load ten controls in this case if he shutdown the machine means when he restart the machine i need to bring the all controls back what he was load the controls before he shutdown. thanks in advance
is there is any possible to achive this without store the current control set, and positions etc..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要查看类似
实用程序
使用此组件进行布局
基本上可以归结为,您需要一种方法来存储当前控件集,并将位置(也可能是值)存储到某种存储(XML 文件、注册表、数据库)。用户退出您的表单/应用程序。
然后,一旦他们重新打开表单/应用程序,您需要检索给定用户的这些设置(如果有)并将表单/应用程序恢复到该状态。
You need to look at something like
Utility
layout with this component
Basically what it boils down to, is that you need a way to store the current control set, and positions (possibly values too) to some sort of storage (XML file, Registry, Database) when the user exits your form/application.
Then once they reopen the form/application, you need to retrieve these settings for the given user (if any is available) and restore the form/application to that state.
如何为 Control 类创建扩展方法?
(实际上,适当的.NET抽象基类,Control类的子类,取决于UI。你使用Windows Forms或XAML还是ASP.NET?)
类似的东西:
然后在你的结束循环中像
和打开像
How about making extension methods to Control class?
(Actually, appropriate .NET abstract base class, a sub-class of Control class, depending on UI. Do you use Windows Forms or XAML or ASP.NET?)
Something like:
Then in your closing just loop like
and opening like