Assign a type to an object at runtime in vb.net or c# -


I have an object, o, and one type, t. I want to use the image to type object o T on the runtime without turning it on.

Compilation time will be equivalent:

  dot = nothing =  

I

  Dim P () as new point  

But I explain as to how to use Activator.CreateInstance to create an instance at runtime Do not want to do this I do not have any knowledge of constructor parameters like this and there are some types of parasailable constructor. Font.

So, in short, I want a way to equalize this:

  T = nothing as dim o  

If you are wondering why I am doing this, that's because I am using a property grid type on the form to edit. If this is the first time for editing, then say, a font, the default value is displayed to the grid by passing an unpublished font for the property grid.

Cheers.

I tried 'o = GetUninitializedObject (T)', but propertyGrid either a properly set object, with an initial object or an object, a defined type Wants to

I have really solved my special problem here:

, but I still must know that without a cover class run -That is how to specify a type on the timeline (which I was lucky enough to use).

The closest thing is << strong> default (t) . Assuming the default is nothing (empty), you will get a default value such as rectangle Empty or 0 (int).

Nothing (tap) is not a type associated with it, so if o, (t) anything in the form of the object will not help.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -