I want to programmatically determine the space I\'ve got for some controls I want to create dynamically. So, I want to get the container\'s height and divide it by the number of
pass dynamicPanel as parameter to static method
public partial class CRLoginsMainForm : Form {
int controlHeight = getControlHeightToUse(dynamicPanel);
change getControlHeightToUse as below
private static int getControlHeightToUse(Panel panel) {
return (panel.Height / NUMBER_OF_ROWS);
}
if you want to call non static method from static method you can do as below
public class Foo
{
// public method
public void Method1()
{
}
public static void Data2()
{
// call public method from static method
new Foo().Method1();
}
}