-1

I've just started learning how to code in C# and I'm trying to make a program that should help learning french vocabulary.

Since I'm not good in SQL-Databases yet, I'm using a VocabArray and a TransArray to define the vocabulary.

In the next step, I want to add a new word. I'm doing that through two text boxes that should add their string to the array in the main form. But how do I access the array from the main form through the textboxes in my new form?

SiHa
  • 7,830
  • 13
  • 34
  • 43
Oscorp
  • 1
  • 1
  • Possible Duplicate [How to access one form's property from another?](http://stackoverflow.com/questions/21022854/how-to-access-one-forms-property-from-another) – M. Adeel Khalid Feb 13 '17 at 12:12
  • Just FYI: C# has a [Dictionary](https://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.110).aspx) that might be more suitable for your program than two arrays. – FishBasketGordo Feb 13 '17 at 12:14

1 Answers1

0

Other than the fact an array doesn't really support your purpose (Dictionary<string, string> or List<Tuple<string, string>> would be better) You can just make a static variable like so:
internal static string[] arr = {"something", "something else"};
Put this in the class but outside the methods

EpicKip
  • 4,015
  • 1
  • 20
  • 37