Array
-
I declare "private System.Windows.Forms.Panel mypanel;" in window form to get a panel name my panel. Can i declare "System.Windows.Forms.Panel [] mypanel;" to get an array of panel because i want to generate couple of mypanel during runtime...
-
I declare "private System.Windows.Forms.Panel mypanel;" in window form to get a panel name my panel. Can i declare "System.Windows.Forms.Panel [] mypanel;" to get an array of panel because i want to generate couple of mypanel during runtime...
Yes you can, you just have to remember to new up each panel in the array prior to use...
-
Yes you can, you just have to remember to new up each panel in the array prior to use...
Thanks for the useful information
-
Thanks for the useful information
However, it's not really going to work. To do this, you need when you create each Panel, pass it into the forms Controls collection, and it's often easier just to create Panels and find them from the Controls collection. foreach(Control c in Controls) { if (c is Panel) { } // OR Panel p = c as Panel; if (p != null) { } }
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )