Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7516911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:16:59+00:00 2026-05-30T01:16:59+00:00

I want to create a List in an ActiveX component project in Visual Basic

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:17:00+00:00Added an answer on May 30, 2026 at 1:17 am

    With c#, you can create your own controls. You have different possibilities to do that.

    1. Derive as class from System.Windows.Forms.Control and add your functionality. This is the most flexible, however most complicated approach.
    2. Derive as class from an existing control which comes close to what you want to do and adapt it (e.g. by overriding OnPaint).
    3. Add a UserControl to your project. You can place other controls on a UserControl much 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 ListBox and override OnPaint in 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 ListBox that I customized this way

    Example of customized ListBox


    EDIT:

    Are you looking for an alternative to the Collection type of VB6? In C# or VB.NET you use collections of the System.Collections.Generic namespace. List<T> for lists and Dictionary<TKey,TValue> for storing key/value pairs.

    Example of lists:

    var list = new List<string>();
    list.Add("Hello");
    list.Add("World");
    
    Console.WriteLine(list[0]); // ==> "Hello"
    Console.WriteLine(list[1]); // ==> "World"
    
    foreach (string s in list) {
        Console.WriteLine(s);
    }
    // Output:  Hello
    //          World
    

    Example of key value pairs:

    var dict = new Dictionary<string,int>();
    dict.Add("Sunday", 1);
    dict.Add("Monday", 2);
    dict.Add("Tuesday", 3);
    dict.Add("Wednesday", 4);
    dict.Add("Thursday", 5);
    dict.Add("Friday", 6);
    dict.Add("Saturday", 7);
    
    Console.WriteLine(dict["Wednesday"]); // ==> 4
    
    int daynum;
    if (dict.TryGetValue("Christmas", out daynum)) {
        Console.WriteLine("Christmas has the day number {0}.", daynum);
    } else {
        Console.WriteLine("Christmas is not a weekday.");
    }
    

    EDIT:

    In order to use an ActiveX created with VB6 in .NET, you need the command line utility TlbImp provided in the .NET SDK. Call it like this

        tlbimp MyActiveX.dll /out:MyCsharp.dll
    

    Then you can use MyCsharp.dll like any other .NET dll. See C# and ActiveX DLLs by Anand Narayanaswamy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a list of integers from 1 to n . I
I want to create a List of KeyValuePair s in a managed C++ project.
I want to create a list of lambda objects from a list of constants
I`v come across a need where I want to create multiple list items from
I want to create a scrollable list of pictures fetched from the internet and
I want to create a list of columns in SQL Server 2005 that have
I want to create a list of methods to execute. Each method has the
I want to create a list of category terms (contained within a block), with
I want to create a list of GridBagPanel.Constraints . I read it in the
Sorry for the Newb-ness. I want to create a list of view elements in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.