Results 1 to 12 of 12

Thread: Trying to create save file for checkboxes

  1. #1

    Thread Starter
    Member G33kman's Avatar
    Join Date
    Nov 2009
    Location
    Mankato, MN
    Posts
    40

    Question Trying to create save file for checkboxes

    Ok so with my program i'm trying to create a save configuration I have it in my context menu so that I can click save configuration and what i want it to do is check to see what check boxes are checked and save those to a file (i.e. a notepad file or whatever works) that way I can save categories for customers or my own computer or whatever and than i'll just click load and choose the category I want and it will load the checkboxes that I want to install. I found a similar post but it's not really making sense to me. So i'm wondering what I need to do to make this work. If you'd like to see my code I can post it but I don't have anything written in there now for what i'm trying to do I'll post the pictures so you can hopefully see what i'm trying to do. Thanks in Advance!

    I'm also wondering how i'm going to load the configuration but I might have to wait on that one step at a time.

    Link to Similar Post

    What's in Green is what I want to select to save the checkboxes and the stuff in Red is the checkboxes i want it to save. I'd like to have it open a new box asking me what i'd like to save the configuration as and that save it...

    Man this seems like a lot of work I hope i'm not asking to many questions i'm trying to figure this stuff out but it's quite confusing sometimes. Sometimes it's not that bad...

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Trying to create save file for checkboxes

    Hey,

    Have you heard of My.Settings? You could create settings for everything that you want to save, and read and write to these settings. There is a link in my signature about this.

    Or, you could create a custom class, and serialize and deserialize an instance of this class that contains all of your properties. Again, there is a link in my signature about this.

    Hope that helps!!

    Gary

  3. #3

    Thread Starter
    Member G33kman's Avatar
    Join Date
    Nov 2009
    Location
    Mankato, MN
    Posts
    40

    Re: Trying to create save file for checkboxes

    Thanks for the direction! I appreciate it! I'll check those out The My.Settings i've heard of in my book and it makes more sense than the other one but i'll check them both out and see if I can make it work. Thanks again.

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Trying to create save file for checkboxes

    Hey,

    Depending on exactly what you are doing, My.Settings will work perfectly. But as soon as you start getting outside it's comfort zone, i.e. saving the file to different location, allowing separate files for user's without re-logging into windows, then it starts to struggle, that is where custom class serialization can come into play.

    Hope it works out for you!

    Gary

  5. #5

    Thread Starter
    Member G33kman's Avatar
    Join Date
    Nov 2009
    Location
    Mankato, MN
    Posts
    40

    Re: Trying to create save file for checkboxes

    Ok so i've done some reading on those links that you gave me and i'm still a lost. I found the Application settings property in the properties section which (I think) is what I need but I'm still confused on what I need to do exactly... I created a new form that pops up asking what to name the save as and I would like it to just save the configuration to like an xml file or something that way there can be multiple configuration saves in one place. If you could help me out it'd be great!
    If you're willing to help me out just let me know what you need to see and i'll post it up here. I'd like to do it myself so that I can learn it but I just need a walkthrough so i know what needs to be done.
    The other thing I was wondering was would you mind if I put your screen name in my program as a thank you for helping me out?

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Trying to create save file for checkboxes

    Hey,

    Ok, first of all, you have to decide everything configuration parameter that you want to save. Then, for each parameter, create a Setting in the Application page, which is User Scoped. Set the type of this setting to be what you want to save, i.e. a string, a boolean etc.

    Then, in your form, set the value of each of the settings to the value of the configuration parameter, then call Save on those settings.

    Then, when you start up the application again, read the value of the settings, and use them in the application.

    The .Net Framework does everything else for you. You don't need to worry about the xml file it creates, or anything like that. Just the loading and saving of the settings.

    Gary

    P.S. Nope, I wouldn't have a problem with that at all.

  7. #7

    Thread Starter
    Member G33kman's Avatar
    Join Date
    Nov 2009
    Location
    Mankato, MN
    Posts
    40

    Re: Trying to create save file for checkboxes

    Quote Originally Posted by gep13 View Post
    Hey,

    Ok, first of all, you have to decide everything configuration parameter that you want to save. Then, for each parameter, create a Setting in the Application page, which is User Scoped. Set the type of this setting to be what you want to save, i.e. a string, a boolean etc.

    Then, in your form, set the value of each of the settings to the value of the configuration parameter, then call Save on those settings.

    Then, when you start up the application again, read the value of the settings, and use them in the application.

    The .Net Framework does everything else for you. You don't need to worry about the xml file it creates, or anything like that. Just the loading and saving of the settings.

    Gary

    P.S. Nope, I wouldn't have a problem with that at all.
    Ok just so i'm following you (from what my brain can comprehend right now)

    you have to decide everything configuration parameter that you want to save.(This would be whether the checkbox is checked, correct?)

    Then, for each parameter, create a Setting in the Application page, which is User Scoped (This is going into the Application settings for the checkbox itself and make sure that it is user scoped?)

    Set the type of this setting to be what you want to save, i.e. a string, a boolean etc. (Would this be setting the Name in the Application settings?)

    After that i'm totally lost (If i'm not totally lost already...) Sorry man I don't mean to bother you.

    I appreciate your help though!

  8. #8

    Thread Starter
    Member G33kman's Avatar
    Join Date
    Nov 2009
    Location
    Mankato, MN
    Posts
    40

    Re: Trying to create save file for checkboxes

    OH! I found the application page!!!! Alright let me see if I can figure it out I'm trying to read your link on my.settings and understand all that so maybe I can figure it out...

    Ok so I have this Application Page open and i'm looking at what you want me to do and I think it's starting to make sense but the problem i'm seeing is that I don't know all the Configuration Parameters to use cause I want it to be something that each person could select there own and than save it as there own configuration.

    i.e. One person might want to choose 5 of the 10 apps as a configuration for there own computer and 10 of the 10 apps for a customers computer where I might want to only choose 3 of the 10 apps for my computer and 9 of the 10 apps for a customers computer...

    That's why I was thinking an xml file or something so that they can choose there own checkboxes and than just save it as Family and than choose different ones and just save it as Customers.

    I guess i'll just leave it alone for the night and let you read my new book of posts and see what your thoughts are before I stay up all night and find ten other things that I don't understand and have the old lady wake up for work and call me an idiot for staying up all night working on this program (again...) Well good luck reading all this I'll talk to you later.

    if you'd like to im me you could add me on Messenger at [email protected]
    Last edited by G33kman; Nov 18th, 2009 at 01:48 AM. Reason: Tried figuring it out and ended up with more Q's...

  9. #9
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Trying to create save file for checkboxes

    Quote Originally Posted by G33kman View Post
    you have to decide everything configuration parameter that you want to save.(This would be whether the checkbox is checked, correct?)
    Yip

    Quote Originally Posted by G33kman View Post
    Then, for each parameter, create a Setting in the Application page, which is User Scoped (This is going into the Application settings for the checkbox itself and make sure that it is user scoped?)
    Yip

    Quote Originally Posted by G33kman View Post
    Set the type of this setting to be what you want to save, i.e. a string, a boolean etc. (Would this be setting the Name in the Application settings?)
    Not quite no, in addition to the Name of the setting, there should be a type column which is a drop down list that you can select the type from.

  10. #10
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Trying to create save file for checkboxes

    Quote Originally Posted by G33kman View Post
    That's why I was thinking an xml file or something so that they can choose there own checkboxes and than just save it as Family and than choose different ones and just save it as Customers.
    This is getting into the realm of where My.Settings doesn't always do everything that you want it to. So you may well have to go to the length of creating your own XML file and reading and writing to it to store your data. It is more than possible to do this, it is just slightly more work

    Quote Originally Posted by G33kman View Post
    if you'd like to im me you could add me on Messenger at [email protected]
    I am more than happy to help you where I can, but I would suggest that we keep it within the forum thread, that way other people who come across this thread can benefit from what turns up.

    Gary

  11. #11

    Thread Starter
    Member G33kman's Avatar
    Join Date
    Nov 2009
    Location
    Mankato, MN
    Posts
    40

    Re: Trying to create save file for checkboxes

    Sounds good man I'll get to work on that xml form and see what I can figure out with it i'll post what I can figure out

  12. #12
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Trying to create save file for checkboxes

    Hey,

    As per your PM, if you want to upload the project somewhere that I can get a hold of it, I will take a look if I get a second.

    Gary

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width