且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在VB.NET中单击按钮后永久隐藏标签

更新时间:2023-12-06 12:33:28

Quote:

我想永远隐藏标签,

很明显,只是把它藏起来。你自己也做了,对吧?

引用:

即使程序重启

现在是问题。在这种情况下,您需要在本地文件,JSON文件,XML或您自己定义的内容中维护程序的状态。



概念是序列化/反序列化,您必须将应用程序的状态存储在文件中并再次加载。加载文件后,您将检查是否显示该按钮。



我写过一篇文章,讲述了JSON中的相同概念,请阅读并探讨如何将它用于自己的目的,使用C#在JSON中从零到英雄 [ ^ ]


Hi, I want to hide the label forever, when it's clicked on the button, even if the program is restarted

What I have tried:

Hi, I want to hide the label forever, when it's clicked on the button, even if the program is restarted

Quote:

Hi, I want to hide the label forever,

Quite obvious, just hide it. That you have done yourself, too, right?

Quote:

even if the program is restarted

Now that is the problem. In this case you need to maintain the state of the program in a local file, a JSON file, XML, or something that you have defined for yourself.

The concept is serialization/deserialization, you would have to store the state of the application in the file and load it back again. Upon loading the file, you will then check whether to show the button or not.

I have written an article that speaks about the same concept in JSON, please read it and explore how you can use it to your own purpose, From zero to hero in JSON with C#[^]