If varible is string, then to check if it is null use:

if (containerid.IsNullOrEmpty())
{  containerid = "-1"; }

Or String.IsNullOrEmpty()

Because null is not empty...

Start new Windows Forms Application, for example, name it MyInheritance.

In solution explorer right clink on MyInheritance, like on picture:

Then, in project properties under Output type choose Console Application like on picture:

Save it. Put a button on a form (add form if it doesn't exist), build project.


Then, to test it, go to the File -> Add -> New project... Then choose Windows Forms Application, in the solution explorer right click on References, go to the project tab and choose MyInheritance, then right click on this new project -> Add -> New item ->Windows Forms -> Inherited Form -> Ok and this is it.


If you want to change a component in your inhertited form, then choose property Modifiers from MyInheritance and change it to Public.


Taken from here.

In VS.NET go to the project property page and in configuration properties>build set Allow Unsafe Code Blocks to True.

Taken from here.