0

I want to get all constructors in class Form1 to calculate the RFC, yes I can get ComboBox constructor because I can get it from Form1() body but I can't get other constructor like new TextBox(); or new Button(); because the it out of any method body and lie directly in class body

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        ComboBox cm = new ComboBox();

    }
    TextBox tttttttttttttttttt = new TextBox();
    Button bbbbbbbb = new Button();

}
Martin Verjans
  • 4,675
  • 1
  • 21
  • 48
mohammed
  • 21
  • 1
  • They are global variables not constructors methods. You are trying to get method and you need variables. – jdweng Jun 03 '17 at 11:05
  • iam need to get all called method that lie directly in class body and out of any methodbody . take (int count = ClassA.cac_RFC();) instead of (Button bbbbbbbb = new Button();) – mohammed Jul 17 '17 at 11:39
  • Use Reflection : see https://stackoverflow.com/questions/5475209/get-class-methods-using-reflection – jdweng Jul 17 '17 at 12:39

0 Answers0