In the Exploring the TimeCheck Application (Part 2) post, you saw how the main form for this application goes together. When a user clicks Configure, the application displays a configuration dialog. The configuration dialog is special because it displays in one of two different ways. When an administrator is using the application, the dialog box contains a full set of entries that allow complete application configuration for both personal and group settings. When any other user is working with TimeCheck, the dialog box displays only the user’s personal settings. You’ll see how this works later. For now, all you need to know is how to create the initial form, which contains the full set of configuration options as shown here.
Of course, before you can configure the form, you need to add it to the application. The following steps will help you add this form to the application.
- Right click the project entry in Solution Explorer and choose Add | Windows Form from the context menu. You’ll see the Add New Item dialog box shown here.
- Type frmConfigure in the Name field and click Add. Visual Studio will add the new form to the project for you and automatically open it for editing.
Now that you have a new form to use, it’s time to add the controls. The following table describes how to add the controls to this dialog box.
Control | Property | Value |
Form1 | (Name) | frmConfigure |
AcceptButton | btnOK | |
CancelButton | btnCancel | |
FormBorderStyle | FixedDialog | |
Size | 400, 420 | |
Text | Configure TimeCheck | |
ToolTip1 | (Name) | toolTip1 |
FolderBrowserDialog1 | (Name) | NetworkSelect |
Description | Choose a Network Location | |
RootFolder | MyComputer | |
SelectedPath | C:\ | |
Button1 | (Name) | btnOK |
AccessibleDescription | Accept the Configuration Changes | |
Location | 307, 12 | |
Size | 75, 23 | |
TabIndex | 0 | |
Text | &OK | |
ToolTip on toolTip1 | Accept the Configuration Changes | |
Button2 | (Name) | btnCancel |
AccessibleDescription | Exit Without Making Changes | |
DialogResult | Cancel | |
Location | 307, 41 | |
Size | 75, 23 | |
TabIndex | 1 | |
Text | &Cancel | |
ToolTip on toolTip1 | Exit Without Making Changes | |
Label1 | (Name) | lblProjectName |
AccessibleDescription | Supply the Name of the Project You Work On Most Now | |
Location | 12, 9 | |
Size | 108, 13 | |
TabIndex | 2 | |
Text | Default &Project Name | |
ToolTip on toolTip1 | Supply the Name of the Project You Work On Most Now | |
ComboBox1 | (Name) | cbProjectName |
DropDownStyle | DropDownList | |
Location | 12, 25 | |
Size | 289, 21 | |
TabIndex | 3 | |
Label2 | (Name) | lblWorkType |
AccessibleDescription | Choose the Type of Task Normally Performed | |
Location | 12, 49 | |
Size | 142, 13 | |
TabIndex | 4 | |
Text | Default Type of &Work (Task) | |
ToolTip on toolTip1 | Choose the Type of Task Normally Performed | |
ComboBox2 | (Name) | cbWorkType |
DropDownStyle | DropDownList | |
Location | 12, 65 | |
Size | 289, 21 | |
TabIndex | 5 | |
Label3 | (Name) | lblNetLocation |
AccessibleDescription | Location of the Data Files | |
Location | 12, 89 | |
Size | 91, 13 | |
TabIndex | 6 | |
Text | &Network Location | |
ToolTip on toolTip1 | Location of the Data Files | |
TextBox1 | (Name) | txtNetLocation |
Location | 15, 105 | |
Size | 255, 20 | |
TabIndex | 7 | |
Button3 | (Name) | btnNetSelect |
AccessibleDescription | Display a Dialog to Choose the Network Location | |
Location | 276, 102 | |
Size | 25, 23 | |
TabIndex | 8 | |
Text | … | |
ToolTip on toolTip1 | Display a Dialog to Choose the Network Location | |
CheckBox1 | (Name) | chkCustomProject |
AccessibleDescription | Determines the Availability of Custom Project Entries | |
Location | 12, 131 | |
Size | 125, 17 | |
TabIndex | 9 | |
Text | A&llow Custom Project | |
ToolTip on toolTip1 | Determines the Availability of Custom Project Entries | |
CheckBox2 | (Name) | chkCustomWork |
AccessibleDescription | Determines the Availability of Custom Work Entries | |
Location | 12, 154 | |
Size | 151, 17 | |
TabIndex | 10 | |
Text | Allow Custom &Task Entries | |
ToolTip on toolTip1 | Determines the Availability of Custom Work Entries | |
Label4 | (Name) | lblStandardProjects |
AccessibleDescription | Contains the List of Predefined Projects | |
Location | 12, 174 | |
Size | 121, 13 | |
TabIndex | 11 | |
Text | &Standard Project Entries | |
ToolTip on toolTip1 | Contains the List of Predefined Projects | |
ListBox1 | (Name) | lstStandardProjects |
Location | 12, 193 | |
ScrollAlwaysVisible | True | |
Size | 208, 82 | |
TabIndex | 12 | |
Button4 | (Name) | btnProjAdd |
AccessibleDescription | Add a New Project | |
Location | 226, 193 | |
Size | 75, 23 | |
TabIndex | 13 | |
Text | &Add | |
ToolTip on toolTip1 | Add a New Project | |
Button5 | (Name) | btnProjEdit |
AccessibleDescription | Edit a Standard Project | |
Location | 226, 222 | |
Size | 75, 23 | |
TabIndex | 14 | |
Text | &Edit | |
ToolTip on toolTip1 | Edit a Standard Project | |
Button6 | (Name) | btnProjDelete |
AccessibleDescription | Delete a Standard Project | |
Location | 226, 251 | |
Size | 75, 23 | |
TabIndex | 15 | |
Text | &Delete | |
ToolTip on toolTip1 | Delete a Standard Project | |
Label5 | (Name) | lblStandardTasks |
AccessibleDescription | Contains the List of Predefined Tasks | |
Location | 12, 278 | |
Size | 82, 13 | |
TabIndex | 16 | |
Text | Standard Tas&ks | |
ToolTip on toolTip1 | Contains the List of Predefined Tasks | |
ListBox2 | (Name) | lstStandardTasks |
Location | 12, 294 | |
ScrollAlwaysVisible | True | |
Size | 208, 82 | |
TabIndex | 17 | |
Button7 | (Name) | btnTaskAdd |
AccessibleDescription | Add a Standard Task | |
Location | 226, 294 | |
Size | 75, 23 | |
TabIndex | 18 | |
Text | &Add | |
ToolTip on toolTip1 | Add a Standard Task | |
Button8 | (Name) | btnTaskEdit |
AccessibleDescription | Edit a Standard Task | |
Location | 226, 323 | |
Size | 75, 23 | |
TabIndex | 19 | |
Text | &Edit | |
ToolTip on toolTip1 | Edit a Standard Task | |
Button9 | (Name) | btnTaskDelete |
AccessibleDescription | Delete a Standard Task | |
Location | 226, 352 | |
Size | 75, 23 | |
TabIndex | 20 | |
Text | &Delete | |
ToolTip on toolTip1 | Delete a Standard Task |
Most of these controls are self-explanatory. For example, if you click OK the application accepts the changes you made. Clicking Cancel will cancel all of the changes you made.
A user can change his/her default project name and task. Otherwise, the settings are changed by the administrator. However, the network path is stored with the user’s local settings. The reason for this is that the application will know the location of the user’s data when it starts, so it can obtain the network path from the user’s data. It won’t know the location of the data on the network, so it can’t obtain the network path as part of the group data. In addition, the network path could be different for each user, so a per-user setting is necessary.
A project entry is an account for a particular project that the user is working on. That project name could be anything from a customer account number to a plain text description of the project. A task entry is a specific task that the user performs on that project. For example, a project might be ABC Corporation Tax Records, while a task entry might be Data Entry. A user will normally perform a specific number of tasks on a particular project.
Next week we’ll look at the dialog boxes used to configure and show reports. Until then, let me know if you have any questions about the setup or use of this dialog box at John@JohnMuellerBooks.com. You can see the next post in this series at Exploring the TimeCheck Application (Part 4).