The previous post (Exploring the TimeCheck Application (Part 12)) discussed how to manage the project and task entries that the user needs to sign into the system. In this post, you see the code used to manage the remaining configuration options on frmConfigure. The last administrator-specific configuration options are the Allow Custom Project and Allow Custom Task Entry check boxes. Checking these two boxes will allow the user to type non-standard entries for signing into the system. Otherwise, the user must sign in using the administrator-provided options. Providing separate configuration options makes sense because there are times when you want to control these features individually. Here is the simple code used for the check box CheckChanged event handlers.
As you can see, the event handlers simply make a change to the GroupData properties and then save GroupData to disk. Other parts of the application read the GroupData information and use it to configure the interface as appropriate. As with other administrator-level settings, you’ll see how to hide these options in a later post. For now, all you’re trying to do is create a working application.
One of the configuration options, Network Location, is administrator-specific, even though the application stores it as part of the user settings. Hiding the setting from view is helpful, but realistically, this is one option that the user can change without permission by editing the configuration file directly. Most users won’t have the required skills, but you need to be aware of the potential for problems with this one setting. Here is the code used to set the network location that is used to provide a pointer to group data on the server.
Notice that the application shows the NetworkSelect dialog box to the user. If the user chooses a new network location and clicks OK, the application will change the network location in the txtNetLocation text box and also saves the data to disk.
The last two configuration options are user-specific, so you always see them displayed on screen. The user needs to be able to select a default project and task. Doing so makes the task of logging into the system easier and faster. Anything that speeds user activities will only give the reader more reasons to use your application. Here is the code used for these last two options.
As in other cases in this post, the application stores the information in the appropriate place and then stores it on disk. At this point, you have all of the code required to configure the application for use. Next week, we’ll discuss the remaining code used to make frmConfigure work. Let me know if you have any questions about this segment of the code at John@JohnMuellerBooks.com.