Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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
Posted
Updated 30-Nov-18 18:49pm

1 solution

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#[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900