Link to home
Start Free TrialLog in
Avatar of andy7789
andy7789

asked on

VB.NET: how to build COM DLL with XP Visual styles

Hi x-perts,

I need to build a windows form to be further connected to VBA application vis DLL reference.

I build it in Visual studio as a Class Library. if I select Class Library, the "Enable Application Framework is grayed out" and I cannot select XP visual styles.

If I build it as windows application, I cannot connect it as COM in VBA references.

How can I do this?

To summarize: I need a XP style windows form to me accessible from VBA.

Please, help,

Thanks

ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andy7789
andy7789

ASKER

Let me try this....

it says: "To enable visual styles in the client area of a Windows form, add the following code to your application's Main method."

Application.EnableVisualStyles()

where exactly should I add it? Into VB.NET code or the VBA code, which calls the form? Where application Main method?

I have just tried this and it doesn't work. The symptoms:

1) If I build that form as a windows application, it shows fine
2) if I build the form as a class and link it as VBA reference (for Excel), it doesn't. I think the problem is that Excel VBA needs some additional reference for control (I saw some mentioning of Common Controls 6, but cannot find it in referfences)

any thoughts?
I didn't tried yet, and I'm not shure if it works right, but add that in the form load event.
Thanks a lot!!!!!!!!

after a few tries I have managed to get it done by adding

System.Windows.Forms.Application.EnableVisualStyles()

before 1st line of

Form.show()

Thanks again - great help