Code:1. CheckWordFromTheDictionaryFunction() 2. MoveNextFunction ()
Step .1
OnButtonClick_Event
Step. 1.A.Code:3.1. Raise the event that will trigger the CheckWordFromTheDictionaryFunction.
Duties: - CheckWordFromTheDictionaryFunction
Instructions:Code:1. To strickly check if the currentword is in the dictionary or not. But it should not move next!
Step .1 .BCode:(1.) To check if the RichTextBox is Not Null, if it is Null, quit. MessageBox.Show("You have no words to check!") (2.) ElseIf Not Null, (A.) Check if the Currentword is in the dictionary If the Currentword is found, (B.) take the words from the second column, and store them into a CurrentSuggestions Variable. ElseIf the Currentword from the RichtextBox is not found, call the MoveNextFunction to move to the NextwordIndex.
Duties:- MoveNextFunction
InstructionsCode:1. To strickly move to the NextwordIndex without doing anything else!
Step. 2Code:1.1 The MoveNextFunction will move to the NextwordIndex of the RichTextBox, and then call the CheckWordFromTheDictionaryFunction. 1.3. If the CheckWordFromTheDictionaryFunction does not find the Currentword that has been moved to, it will call the MoveNextFunction to move to the NextwordIndex.
Code:
Step. 3Code:If the Currentword was found. 2.1. Highlight the Currentword to be replaced. Clear the ContextMenuStrip.Clear() because of repetitive tasks, and 2.2. Load the items from the CurrentSuggestions variable into the ContextMenuStrip.
Hence, here the program is ideal.Code:3.2. If no Currentword was found from the dictionary in the whole document by the CheckWordFromTheDictionaryFunction after the MoveNextFunction was called. A messageBox.Show() function will be shown with("No Matches were found from the dictionary in the whole document!"). When the user clicks the OK button of the MessageBox.Show() The CheckWordFromTheDictionaryFunction should be stopped without closing the whole program. Otherwise, there is already a Me.Close() function on the BtnClose Button.
Step .4
Step. 5Code:If Currentword was found, display the ContextMenuStrip, and allow the user to select what he or she wants. ElseIf the Currentword was not good. The MoveNextFunction will be called. ElseIf the CurrentSuggestions are good. Replace the Currentword with CurrentSelectedSuggestion Item from the contextMenuStrip.
Code:
TerminologiesCode:It will now wait for the User to click the button again for the CheckWordFromTheDictionaryFunction to be called. We have agreed that the CheckWordFromTheDictionaryFunction is to check the Currentword from where it has been moved to! ElseIf all the replacements have been made, MessageBox.Show("The task is Completed."). End.
Code:1. The CheckWordFromTheDictionaryFunction is the function to do the checking. 2. The MoveNextFunction is in charge of moving to the NextwordIndex.
Keywords to be used in the program:Items to be created:Code:Currentword, CurrentSuggestions Variable, NextwordIndex, CurrentSuggestions, CurrentSelectedSuggestion Item
Functions to be createdCode:Button for search, Button for Close, ContextMenuStrip1, RichTextBox1, Connection to a Dictionary path.
Code:1. CheckWordFromTheDictionaryFunction 2. MoveNextFunction


Reply With Quote
. I know it probably felt a bit laborious to get to this point but, believe me, it was necessary and I hope it hasn't put you off programming. As you get more experienced you can probably start skipping a lot of this forward planning and jump straight into code but when you're just starting out it's hugely valuable.
