I want to create a List in an ActiveX component project in Visual Basic 6.0. Then I will get
the list from a c# project.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
With c#, you can create your own controls. You have different possibilities to do that.
System.Windows.Forms.Controland add your functionality. This is the most flexible, however most complicated approach.OnPaint).UserControlto your project. You can place other controls on aUserControlmuch like you place controls on a form.You can do this in your main assembly (.exe); however, if you do this in a class library (.dll), then you can use it much like an ActiveX control. In .NET, you do not need the “magic” of an ActiveX control. Controls are just classes that derive from
Control.I often derive my own controls from
ListBoxand overrideOnPaintin order to display the items in a different way, by adding icons, by using different colors or by displaying text on multiple lines.This is an example of a
ListBoxthat I customized this wayEDIT:
Are you looking for an alternative to the
Collectiontype of VB6? In C# or VB.NET you use collections of theSystem.Collections.Genericnamespace.List<T>for lists andDictionary<TKey,TValue>for storing key/value pairs.Example of lists:
Example of key value pairs:
EDIT:
In order to use an ActiveX created with VB6 in .NET, you need the command line utility
TlbImpprovided in the .NET SDK. Call it like thistlbimp MyActiveX.dll /out:MyCsharp.dllThen you can use
MyCsharp.dlllike any other .NET dll. See C# and ActiveX DLLs by Anand Narayanaswamy.