CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    33

    Question Load Value From Config File and Automatically Tick the Checkbox

    Hi,

    I have a dialog form that contains 4 tabs, of which on the 4th tab, i have implemented a check box. When that checkbox is checked, a value of "1" should be stored in the configuration file which i am using for the system.

    When I am loading my application, it should accordingly load the corresponding settings from the configurations file and it should automatically check that checkbox.

    The problem here is,
    I am able to store the settings in my configuration file and I am also able to read that particular value while loading the application.

    But I am not able to automatically tick the checkbox according to the value("1").

    How can I achieve this?

    Regards,
    p_zshk

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Load Value From Config File and Automatically Tick the Checkbox

    Create a control member variable for that checkbox (say, c_myCheck), then use
    Code:
    c_myCheck(TRUE):  //  to check the box
    c_myCheck(FALSE):  //  to uncheck the box
    or if you have an integer var iCheck (0 or 1)
    Code:
    c_myCheck(iCheck):
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2011
    Posts
    33

    Question Re: Load Value From Config File and Automatically Tick the Checkbox

    is there any other way to achieve this?

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Load Value From Config File and Automatically Tick the Checkbox

    Quote Originally Posted by p_zshk View Post
    is there any other way to achieve this?

    What is wrong for you with SetCheck?
    Victor Nijegorodov

  5. #5
    Join Date
    Jul 2011
    Posts
    33

    Smile Re: Load Value From Config File and Automatically Tick the Checkbox

    there is no issue with SetCheck....i have used it before too..and it works fine..

    but the application on which i am operating already have some checkboxes implemented and they have been implemented in a different way...thats why i want to know whether there is an alternative available for this...

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Load Value From Config File and Automatically Tick the Checkbox

    What do you mean under "different way"?
    What type of application are you "operating" with?
    Victor Nijegorodov

  7. #7
    Join Date
    Jul 2011
    Posts
    33

    Question Re: Load Value From Config File and Automatically Tick the Checkbox

    its like..the check box is checked and unchecked without the use of SetCheck...thats why i want ot know about the same...

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Load Value From Config File and Automatically Tick the Checkbox

    How is it "checked and unchecked without the use of SetCheck"?
    Victor Nijegorodov

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

Featured