RE: Accessing Classes from Form

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Quick obeservation

You are getting the exception because NewMaterial has not been instantiated.

The information that you want to retain is nothing but attributes of a
object of the class. So lets say you have 2 materials - Metal and Plastic.
These will correspond to 2 separate instances of the class Materials.

About retaining the information:

What you could do is create a collection of your objects and while invoking
the AddLayer form fill the controls with the last element of your object
collection. That way the form will display the information abt the last
object that you created.

HTH.


.