Does not exist in current context (Visual C#) -
i have error coming saying; name 'map' not exist in current context. doing wrong? sorry quite new coding...
public partial class form1 : form { public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) { variables(); } public static void variables() { string[,] map; map = new string[140, 140]; } public static void updatemap(string[,] map) { messagebox.show("a"); } private void form1_keydown(object sender, keyeventargs e) { updatemap(map); } }
create class variable string[,] map.
public partial class form1 : form { public string[,] map; ...
so variable "map" accessible in all(non-static) methods of class
Comments
Post a Comment