vis781.
No they are not the same. In the light that you speak EVERYTHING is done at development. What I am saying is well, let me explain in detail.
For starters lets say that no matter which way you go you eventually have to declare the object. So if we inherit like so...
Class [COLOR=red]MyForm [/COLOR]
Inherits [COLOR=seagreen]newForm[/COLOR]
Then you still have to declare it to use it.
Dim F as new [COLOR=red]MyForm[/COLOR]
So it already makes more since to just declare what we have.
Dim F as new [COLOR=seagreen]newForm[/COLOR]
Now, to better explain what is meant by programmatically at run time rather than developing is simple. When you declare an object...
...this may or may not ever happen depending on how you code.
And depending on certain options if can be delcared differently.
If x > 10 then
Dim F as new newForm
else
Dim F as new AnotherForm
end if
Now when you inherit you type a new Class.
Class MyForm
Inherits newForm
'here we add a new constructor forcing us to set position of the form
Sub New(byVal Location as Point)
me.location = location
end sub
End Class
You do this to make additions to the way the newForm class originally worked. Then you declare the MyForm class as the seperate object.
If x > 10 then
Dim f as new newForm
f.show
else
Dim f as new MyForm( 500, 500)
f.show
end if
See, now the inherited version has alterations like our constructor.
If you can't dig into that and get the jist of it then it may too much for you to understand but YES there is a Correct way.
vis781
Curious use of inheritance there.. providing a differentially typed but otherwise identical clone of an existing object..
Back to what I said earlier you still have to declare and use it so if you want a clone of an object inheriting is not the solution. Just declare another object of it.