- Joined
- Jul 6, 2013
- Messages
- 1,224
- Reaction score
- 506
For a school project i have to design an exercise on the dutch grammar.
I already worked out most of the program but i am facing 1 problem that i don't know how to fix.
Situation:
I have a class called Grammar and then the mainwindow.
inside class is a method written for the validation between the word filled in in the textbox and the word that it has to be.
In the mainwindow i've made the list of variables that is required.
Now i want the original word that is made in :
To be validated with the word that is filled in into the textbox. The problem is that they are in 2 diffirent classes so they won't recognize eachother.
Should i do it with inheritence from the class with the mainwindow?
I hope i explained it kinda good i'm not sure how to explain it.
ps. Its not allowed to make the variables public in the classes they have to be private.
Greetz
I already worked out most of the program but i am facing 1 problem that i don't know how to fix.
Situation:
I have a class called Grammar and then the mainwindow.
inside class is a method written for the validation between the word filled in in the textbox and the word that it has to be.
Code:
public void valideerwoord(TextBox antwoordTextBlock, Label scrabbleLabel) {
if (antwoordTextBlock.Text.Equals(scrabbleLabel.Content))
{
antwoordTextBlock.Background = BrushJuist;
}
else
{
antwoordTextBlock.Background = BrushFout;
}
}
In the mainwindow i've made the list of variables that is required.
Code:
string woord1 = generatorwoord1.kiesRandomWoord(); // string woord2 = generatorwoord1.kiesRandomWoord(); //
string woord3 = generatorwoord1.kiesRandomWoord(); //
string woord4 = generatorwoord1.kiesRandomWoord(); //
string woord5 = generatorwoord1.kiesRandomWoord(); // Steekt een woord in de variablen
string woord6 = generatorwoord1.kiesRandomWoord(); //
string woord7 = generatorwoord1.kiesRandomWoord(); //
string woord8 = generatorwoord1.kiesRandomWoord(); //
string woord9 = generatorwoord1.kiesRandomWoord(); //
string woord10 = generatorwoord1.kiesRandomWoord(); //
string mixedWoord1 = generatorwoord1.MixLetters(); //
string mixedWoord2 = generatorwoord1.MixLetters(); //
string mixedWoord3 = generatorwoord1.MixLetters(); //
string mixedWoord4 = generatorwoord1.MixLetters(); //
string mixedWoord5 = generatorwoord1.MixLetters(); // Steekt een gemixed woord in de variabelen
string mixedWoord6 = generatorwoord1.MixLetters(); //
string mixedWoord7 = generatorwoord1.MixLetters(); //
string mixedWoord8 = generatorwoord1.MixLetters(); //
string mixedWoord9 = generatorwoord1.MixLetters(); //
string mixedWoord10 = generatorwoord1.MixLetters(); //
Now i want the original word that is made in :
Code:
string woord1 = generatorwoord1.kiesRandomWoord(); // string woord2 = generatorwoord1.kiesRandomWoord(); //
string woord3 = generatorwoord1.kiesRandomWoord(); //
string woord4 = generatorwoord1.kiesRandomWoord(); //
string woord5 = generatorwoord1.kiesRandomWoord(); // Steekt een woord in de variablen
string woord6 = generatorwoord1.kiesRandomWoord(); //
string woord7 = generatorwoord1.kiesRandomWoord(); //
string woord8 = generatorwoord1.kiesRandomWoord(); //
string woord9 = generatorwoord1.kiesRandomWoord(); //
string woord10 = generatorwoord1.kiesRandomWoord(); //
To be validated with the word that is filled in into the textbox. The problem is that they are in 2 diffirent classes so they won't recognize eachother.
Should i do it with inheritence from the class with the mainwindow?
I hope i explained it kinda good i'm not sure how to explain it.
ps. Its not allowed to make the variables public in the classes they have to be private.
Greetz