Solved

Using VB.NET Treeview control in VB6

Posted on 2003-11-19
7
404 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA/SQL - Connect to SQL server and pull data 4 119
Access Object Property from VBA Module in Excel 2010 2 37
Help me. 3 60
MS SQL Update query with connected table data 3 38
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

829 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