How do you call a constructor to initialize a variable using form1?

A Form is a class pretty much the same as any other. If you look at the code(press the <> icon in the solution explorer) you shoud see the constructor for form1 already made for you. It is easy to recognize because it has a call to the InitializeComponent method. Put any initialization code you want after the call to that method.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.