Getting icon from form in dynamically loaded DLL

T

Tom

I have a main VB.NET application that loads another VB.NET DLL
dynamically. Once I have done that, I would like to be able to 'get'
the icon of a form in that dynamically loaded DLL.

How would one go about doing this in the main form, once the DLL has
been loaded? Thanks in advance.

Tom

--
 
A

Armin Zingler

Tom said:
I have a main VB.NET application that loads another VB.NET DLL
dynamically. Once I have done that, I would like to be able to 'get'
the icon of a form in that dynamically loaded DLL.

How would one go about doing this in the main form, once the DLL has
been loaded? Thanks in advance.

If the icon is embedded as a resource, have a look at
System.Reflection.Assembly.GetManifestResourceStream


Armin
 
T

Tom

Armin said:
If the icon is embedded as a resource, have a look at
System.Reflection.Assembly.GetManifestResourceStream


Armin

No, it is actually a part of the form - i.e. I set the form's ICON
property to be an icon file.

Maybe I should word this differently - since I know how to access a
form dynamically - How would one 'get' the icon of a Windows form via
VB?

--
 
A

Armin Zingler

Tom said:
No, it is actually a part of the form - i.e. I set the form's ICON
property to be an icon file.

Maybe I should word this differently - since I know how to access a
form dynamically - How would one 'get' the icon of a Windows form
via VB?


Set the Icon in the Form designer, then have a look at the "Windows Form
Designer generated code" region to see how the resource is loaded.


Armin
 
T

Tom

Armin: I see what you are saying... however, I may have been 'dumb'
about this whole thing... Once I have loaded a DLL, and I know what the
form is, and have a reference to it (i.e. a variable), wouldn't it be
easier to simply reference that forms .Icon property and grab the
icon?? Then I can convert it to a bitmap, picture, whatever....

Tom


--
 
A

Armin Zingler

Tom said:
Armin: I see what you are saying... however, I may have been 'dumb'
about this whole thing... Once I have loaded a DLL, and I know what
the form is, and have a reference to it (i.e. a variable), wouldn't
it be easier to simply reference that forms .Icon property and grab
the icon?? Then I can convert it to a bitmap, picture, whatever....


:) If you already have an instance, of course, you can simply access the
Icon property. But what was the question then?



Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top