Newby control component Question.

RLester

Newcomer
Joined
Aug 17, 2003
Messages
2
Is there any way to use a custom .net control component in a VB 6 application (assuming the .net framework is installed), or is this just Pie in the Sky?
 
If you're using VB.Net you can create a Control Class Library, put in a UserControl and use the attribute COMClass and then right-click the project choose Properties go to Configuration Properties>Build and check Register for COM Interop. I'm not sure how to get the component to function, however but it works well on normal classes. There is probably a better way.
 
Hello and thanks. This was helpful, but I am still puzzled: I built a tiny test control component in VB.NET. It has a label with caption "Hello" and one method which shows a message box with "Hello". I followed your advice, and also build some GUIDs so the component would register. I did a build and it created a DLL. I went into VB6, and added the DLL to the references.

Now, I can declare a new instance of the DLL library, and of the "control" (if it still is a control). I can call the Hello method and see the message box, but I can't figure out how to get the actual control to show. It does not show up in any tab on the compoenents toolbox, but the fact that a DLL was created rather than an OCX gives me a sinking feeling I'may have lost this little battle, if not the war.

Microsoft has a page with a walkthrough for "components" at http://msdn.microsoft.com/library/d...oughCreatingCOMObjectsWithVisualBasicNET.asp, BUT not mention of the word "Control". Perhaps I am out of luck? Any additional info or ideas on where to look would be greatly appreciated!!! Thanks again.
 
Back
Top