将 ViewState 模拟到 WinForm 中

发布于 2024-12-07 11:56:16 字数 452 浏览 4 评论 0原文

如果可以的话,那将是一件很棒的事情。

那么有没有办法以某种方式在 WinForm 应用程序中实现 ViewState 行为。

就像如果我有一堆 TextBoxes ,而不是在其中使用类型文本,TextBoxes 应该存储它们的文本、位置、大小等,并且在下一个应用程序启动时它们应该加载它们的内容文本、位置、大小等。

此外...每个表单中的每个 Control 都应该以某种方式存储它们的状态,并且在加载时,它们应该加载它们的内容和其他属性,就像上次应用程序所在的位置一样 跑步。

PS:如果没有任何库或已经制定的解决方案,请不要尝试花时间编写代码,因为这并不害怕向你们索要代码,我只需要方向和想法,因为我计划通过我的方法来实现它-self.Down-Voter 请考虑这一点!

If it's possible it would be a great thing.

So is there a way how to achieve somehow a ViewState behavior into a WinForm's Application.

Like if i have a Bunch of TextBoxes ,than uses types text into them ,TextBoxes should store Their Text ,Location ,Size etc. and on Next Application Startup they should Load their Content Text ,Location ,Size etc.

Further...every Control into every Form ,should store Their State somehow ,and on Load ,they should Load their Content and Other Properties like they where last time Application was running.

PS : If there is not any Library or already made Solution ,than please don't try to spend time writing Code ,because it's not Fear to ask you guy's for Code ,i need just Direction's and Ideas because i plan to achieve it by my-self.Down-Voter's please consider that!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

<逆流佳人身旁 2024-12-14 11:56:16

使用我的 google-fu 我在代码项目上找到了这个

这个人编写了一些代码,可以有效地将表单序列化为 XML,以便您可以再次将其加载回来。不知道它是否可以处理带有动态控件的表单,当您再次加载表单时,这些控件可能不在表单上 - 但我确信您可以调整代码来执行您想要的操作。

Using my google-fu I found this on code project.

The guy's written some code that effectively serializes a form out to XML so you can load it back in again. Don't know if it would cope with forms with dynamic controls that perhaps aren't on the form when you load it back in again - but I'm sure you can tweak the code to do what you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文