Exploring the TypingBuddy Application (Part 3)

The Exploring the TypingBuddy Application (Part 2) post describes the part of the user interface used to inform the user about the current application status. You also saw the configuration features found on frmMain. This post continues the discussion of the application configuration interface. In order to make TypingBuddy a little more interesting to use, the user requires some method of inputting custom messages and having them saved from session-to-session.

The first part of this interface is to provide some means of working with the group of messages—all of the messages that the user has defined. The frmMessages interface looks like this:

TypingBuddy0301

As you can see, the form provides a simple method of displaying the entire message list. You can click buttons to add, edit, and delete messages as needed. Clicking Close will close the form and return the user to TypingBuddy Settings (frmMain). Here are the settings for this form:

Control Property Value
Form3 (Name) frmMessages
  AcceptButton btnAdd
  CancelButton btnClose
  FormBorderStyle FixedDialog
  Size 290, 290
  Text Configure the Messages
ToolTip1 (Name) toolTip1
Button1 (Name) btnAdd
  AccessibleDescription Add a new entry.
  DialogResult OK
  Location 197, 12
  Size 75, 23
  TabIndex 0
  Text &Add
  ToolTip on toolTip1 Add a new entry.
Button2 (Name) btnEdit
  AccessibleDescription Edit the selected entry.
  Location 197, 41
  Size 75, 23
  TabIndex 1
  Text &Edit
  ToolTip on toolTip1 Edit the selected entry.
Button3 (Name) btnDelete
  AccessibleDescription Deletes the selected entry.
  Location 197, 70
  Size 75, 23
  TabIndex 2
  Text &Delete
  ToolTip on toolTip1 Deletes the selected entry.
Button4 (Name) btnClose
  AccessibleDescription Closes the dialog box.
  DialogResult Cancel
  Location 197, 99
  Size 75, 23
  TabIndex 3
  Text &Close
  ToolTip on toolTip1 Closes the dialog box.
Label1 (Name) lblMessages
  Location 12, 9
  Size 55, 13
  TabIndex 5
  Text &Messages
ListBox1 (Name) lstMessages
  AccessibleDescription Contains a list of messages to display.
  Location 12, 25
  Size 179, 255
  TabIndex 6
  ToolTip on toolTip1 Contains a list of messages to display.

Of course, the application also requires a detail form, frmAddEdit, that makes it possible to work with individual messages. This form has to serve a dual purpose: adding new messages and editing existing messages. Consequently, the code provides the means for modifying the way that the form works, but the designer provides just one view, the one used for adding new messages, as shown here:

TypingBuddy0302

This form contains every setting you can make for an individual message. Some of the settings could be considered ancillary, but they’re nice to have. For example, you could just assume that the user wants to display the message title as part of the message that the application displays, but having the choice allows the user to create more functional message titles that are descriptive, but not necessarily useful in the message title bar. The example uses basic system sounds, which will likely prove enough for most users, but an improvement would allow the user to add any sound desired. Some messages will only work at certain times of the year, so the application also lets the user assign a useful date to specific messages. Here are the settings for this form.

Control Property Value
Form4 (Name) frmAddEdit
  AcceptButton btnAdd
  CancelButton btnClose
  FormBorderStyle FixedDialog
  Size 290, 360
  Text Add a New Message
ToolTip1 (Name) toolTip1
Button1 (Name) btnAdd
  AccessibleDescription Adds the new item to the list.
  DialogResult OK
  Location 197, 12
  Modifiers Public
  Size 75, 23
  TabIndex 0
  Text &Add
  ToolTip on toolTip1 Adds the new item to the list.
Button2 (Name) btnClose
  AccessibleDescription Closes the form without making a change.
  DialogResult Cancel
  Location 197, 41
  Size 75, 23
  TabIndex 1
  Text &Close
  ToolTip on toolTip1 Closes the form without making a change.
Label1 (Name) lblTitle
  Location 12, 9
  Size 73, 13
  TabIndex 2
  Text &Message Title
TextBox1 (Name) txtTitle
  AccessibleDescription Contains the name of the message.
  Location 12, 25
  Modifiers Public
  Size 179, 20
  TabIndex 3
  Text My Message
  ToolTip on toolTip1 Contains the name of the message.
CheckBox1 (Name) chkShowTitle
  AccessibleDescription Determines whether the title is displayed.
  Location 12, 51
  Modifiers Public
  Size 76, 17
  TabIndex 4
  Text &Show Title
  ToolTip on toolTip1 Determines whether the title is displayed.
Label2 (Name) lblMessageText
  Location 12, 71
  Size 74, 13
  TabIndex 5
  Text Message &Text
TextBox2 (Name) txtMessageText
  AccessibleDescription Contains a description of what to do while resting.
  Location 12, 87
  Modifiers Public
  Multiline True
  Scrollbars Vertical
  Size 260, 100
  TabIndex 6
  ToolTip on toolTip1 Contains a description of what to do while resting.
Label3 (Name) lblSound
  Location 12, 190
  Size 78, 13
  TabIndex 7
  Text &Related Sound
ComboBox1 (Name) cbSound
  AccessibleDescription Determines which sound to play when displaying the message.
  Location 12, 206
  Modifiers Public
  Size 121, 21
  TabIndex 8
  ToolTip on toolTip1 Determines which sound to play when displaying the message.
CheckBox2 (Name) chkDateSpecific
  AccessibleDescription Determines whether the message has a timeframe.
  Location 12, 233
  Modifiers Public
  Size 76, 17
  TabIndex 9
  Text &Use Dates
  ToolTip on toolTip1 Determines whether the message has a timeframe.
Label4 (Name) lblStartDate
  Location 12, 253
  Size 69, 13
  TabIndex 10
  Text Starting &Date
DateTimePicker1 (Name) dtStartDate
  AccessibleDescription Defines the starting date for this message.
  Enabled False
  Location 12, 269
  Modifiers Public
  Size 200, 20
  TabIndex 11
  ToolTip on toolTip1 Defines the starting date for this message.
Label5 (Name) lblEndDate
  Location 12, 292
  Size 52, 13
  TabIndex 12
  Text &End Date
DateTimePicker1 (Name) dtEndDate
  AccessibleDescription Defines the ending date for this message.
  Enabled False
  Location 12, 308
  Modifiers Public
  Size 200, 20
  TabIndex 13
  ToolTip on toolTip1 Defines the ending date for this message.

At this point, you have the application designed. The next post in this series will explore the method used to store the user settings on disk. In the meantime, let me know if you have any questions about the application to this point at John@JohnMuellerBooks.com. You can see the next post in this series at Exploring the TypingBuddy Application (Part 4).

 

Author: John

John Mueller is a freelance author and technical editor. He has writing in his blood, having produced 99 books and over 600 articles to date. The topics range from networking to artificial intelligence and from database management to heads-down programming. Some of his current books include a Web security book, discussions of how to manage big data using data science, a Windows command -line reference, and a book that shows how to build your own custom PC. His technical editing skills have helped over more than 67 authors refine the content of their manuscripts. John has provided technical editing services to both Data Based Advisor and Coast Compute magazines. He has also contributed articles to magazines such as Software Quality Connection, DevSource, InformIT, SQL Server Professional, Visual C++ Developer, Hard Core Visual Basic, asp.netPRO, Software Test and Performance, and Visual Basic Developer. Be sure to read John’s blog at http://blog.johnmuellerbooks.com/. When John isn’t working at the computer, you can find him outside in the garden, cutting wood, or generally enjoying nature. John also likes making wine and knitting. When not occupied with anything else, he makes glycerin soap and candles, which comes in handy for gift baskets. You can reach John on the Internet at John@JohnMuellerBooks.com. John is also setting up a website at http://www.johnmuellerbooks.com/. Feel free to take a look and make suggestions on how he can improve it.