Click here to Skip to main content
15,909,051 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello. I need help with something.
If the user pressed button1, pictureBox1 will be invisible. (Visible = false) but if the user restarts the app, pictureBox1 will still be invisible. Can someone help me with this? I'm new to C#.

What I have tried:

I tried with user settings from visual studio but it doesn't work. Maybe i need to do in other way.‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎
Posted
Updated 23-Mar-20 6:03am

1 solution

It depends on the environment in which your app will be running - but you talk of "Settings" in VS implies Winforms, in which case Settings is the right way to go, provided you do it right.
See here: Save and restore your form size and location[^] - it uses Settings to save and restore a form location automatically, so the code you need should be obvious from that
 
Share this answer
 
Comments
Member 14778963 23-Mar-20 12:42pm    
sorry, I dont really know how to make it change the visible property. I am new to C# but i'm sure if i would know a little more I could change it, thank you anyway.
OriginalGriff 23-Mar-20 12:52pm    
How do you set a property - you know that, yes?
Member 14778963 23-Mar-20 13:01pm    
yes, I know how
OriginalGriff 23-Mar-20 13:14pm    
And that code shows how to read a setting, and write it back.
So what is the problem with putting the two bite of information together?

I'm not trying to be funny here, but remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. So when you don't tell us something, we don't know it!

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