Hi,
I'm developing an app where I want to call user controls and load it onto my main form via selections from toolstrip items.
Do I have to make my application MDI and load every user control as a child in the parent container?
As I'm not too familiar with MDI, I don't really want to do it this way.
The other thing that I'm kinda struggling with is this:
I put my connection string to my database in my app.config file, then I wrote a class which has two methods, a string method to get the connection string out of the app.config and a method to create the connection to the SQL database.
Then, I have a logic class with a global variable which references the connection class and uses my createConnection() method. All this works great. On my form's code-behind file, I create a reference to my Logic class and initialize it as 'new' and I can call any method I've created in the logic class.
The problem I'm having now however, is that when I try to do exactly the same thing on a user control, my solution builds and the user control shows up in my toolbox as expected, but as soon as I try and drag it onto my main form I get a NullReferenceException which occurs in my connection class.
I don't understand this and need some help solving it as I've run out of ideas.