I'm a beginner learning C# and I'm currently trying to study how to use the keyboard directional arrow keys to navigate between different arrays in a multidimensional array.
I'm trying to work with a 3x3x3 dimensional array (cube array) and I want to use the arrow keys to navigate between each array and display the contents in that array.
I've already went ahead and filled up the arrays with placeholder data (my array is a
string [,,] Array = new string[3,3,3]
and I filled it up with names of fruits, for example
Array[0,0,0] = "apple";
All I need is to be able to navigate to each array using arrow keys (left, down, up, right) and display each of the fruit contents of the Array.
I've been reading around and I think the best option for me would be to use the Switch Case
switch(arrayContents)
{
case 1: ....
case 2: .....
}
but I don't know how to incorporate the arrow key presses into this. Any help would be appreciated.
Thanks.
EDIT:
I'm working on a console-based app. I'm using Visual Studio. I just want something like array pointers in C++.
Basically, what I want is (if it's possible) to use the arrow keys on the keyboard to navigate between arrays in a 3D cube array and display their contents.
For example, if
Array[0,0,0]="apple";
contains "apple" and
Array[0,0,1]="orange";
contains "orange", pressing the Right Arrow key would "move" the pointer to the array on the right-side and the display would change from "apple" to "orange"
I haven't gotten into WinForms yet, would it be easier to do this via Winforms? If so, how can I go about it. Like I said, I'm only a beginner in C# programming.