Quote:
Originally Posted by RandomCoder
But can I ask, what is a namespace?
|
All .NET classes (objects) live in a namespace, the biggest of these is probably System. You can regard namespaces as a hierarchy, a bit like a folder tree. The namespace in which a class lives is part of the class name so that classes of the same name can be defined in different namespaces without conflict. For example there is a Button object in both System.Windows.Forms and System.Web.UI.WebControls namespaces. You define the namespaces you want to use when writing code. In VB this by "Imports". Then you don't need to use the fully qualified name including the namespace when referring to classes unless there is a conflict. For example if I want to define a Class in a library called "Button" that will be in a namespace I choose and will be the default namespace when the compiler wants to find Button. If I then want to use System.Windows.Forms.Button then that is how I refer to it so the compiler knows it is not my Button I want.
Quote:
|
I'm interested in knowing how the notifyicon is linked to the Form. Can it be done with the door library?
|
Form, NotifyIcon, Button etc. are all Controls. Controls are linked in a hierarchy with, usually, a Window (Form) at the top. A NotifyIcon would be a Child of a Form, the Form being the Parent of the NotifyIcon. Each Control has a Parent property identifying its Parent control and a Controls collection identifying its Child controls. A Control is assigned to a Parent by using the Controls.Add method of its Controls collection - this takes care of unassigning any previous Parent control and assigning the control to the new.
You probably could create a NotifyIcon and add it to a Form using the Door library but accessing its methods and properties would be a bit long winded - its much easier to encapsulate it in a library.