Solved

Using VB.NET Treeview control in VB6

Posted on 2003-11-19
7
397 Views
Last Modified: 2010-05-01
Hi,

I need to use the VB.NET Treeview control in a VB6 application because the VB.NET Treeview control seems to be much faster the the VB6 one with a large amount of data.  My question is how to do it.

I read some articles about interop between .Net and VB6 and tried to subclass from System.Windows.Forms.TreeView in .Net and build either a COM class or User Control, and add the tlb file into VB6 Project References, and use a New to create a VB.Net treeview in VB6.  It didn't work when I call the New.  Is this approach ever going to work?  I don't know if you can add a control on a VB form by calling New.  I can't find a way to add the VB.Net tlb into Vb6 Project Componets.  Is this even possible??

If someone has done it before or know how, please share your thoughts.

Thanks a lot!
0
Comment
Question by:jayleno
  • 2
  • 2
7 Comments
 
LVL 15

Expert Comment

by:SRigney
ID: 9781511
It is possible for you to write your own controls in .Net and have them available for VB6 if you use the correct Attributes with the functions to enable COM functionality, however the .Net controls are not written to be used in VB6.  If the .Net control is faster for your situation, why don't you write the project in VB.Net and have it access any previous VB6 files that are needed?  This is the method that is supported by Microsoft.
0
 

Author Comment

by:jayleno
ID: 9781615
SRigney,

Can you elaberate on "use the correct Attributes with the functions to enable COM functionality"?  I cannot port the project to VB.NET because of the project size and time constraints.  So if you can be more specific on the steps to do it I would appreciate it.
0
 
LVL 15

Expert Comment

by:SRigney
ID: 9781724
Here is a link to MSDN where it talks about how to do it.  I haven't done anything like this myself.  I have opted to convert my applications to .Net as often as possible.  

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconexposingnetframeworkcomponentstocom.asp
0
 

Author Comment

by:jayleno
ID: 10166897
Hi,

Since I did not find any acceptable answer here, I would like to close and delete this question.  I suppose the best thing to do when encountered with a problem like mine is to stick with VB6 (or VB.NET) and look for other facters to solve the problem.

THanks anyway.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 10191293
PAQed, with points refunded (250)

Computer101
E-E Admin
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now