For a start, you cannot have code directly inside a class. Your
class B
code block is missing a function, and will not compile as-is.
Secondly, there's no point creating a new array only to throw it away on the next line:
string[,,,] nn = new string[1,2,3,4];
nn = cc.hh;
Remove the
new string[1,2,3,4]
:
string[,,,] nn;
nn = cc.hh;
You can even join the two lines together:
string[,,,] nn = cc.hh;
Finally, we have no idea what your
allcontrols
method is returning. If you're getting an exception, then it's likely that the method is not returning an array with the expected number of dimensions. If you're getting a blank message box, then the method is returning an array which contains no values.
You need to debug your code to find out what's happening. We can't do that for you.