Setting column width with msflexgrid in

Posted on 2005-04-25
Last Modified: 2008-01-09

I set the old vb6 com object MSFlexgrid as a reference in one of my applications.  However, I've noticed a property that I used to use all the time in vb6 is no longer available.  I used to be able to set the colwidth by doing MSFlexgrid1.ColWidth(column integer goes here) = 1000 etc.....The ColWidth option isn't availble any more even though I am using the same .ocx file that I used to use in vb6.  Any suggestions?

Question by:neo8820
    LVL 5

    Expert Comment

    hello neo
    Check this link it could help :

    Go to [ActiveX Components in .NET]
    I don't have .net installed on my PC ,so I couldn't test it
    LVL 11

    Expert Comment

    MSFlexGrid1.set_ColWidth(1, 1000)

    use the object browser to find the "hidden" (actually just renamed) methods - look down under the set_ and get_ methods
    LVL 1

    Author Comment

    Is there a reason some methods/properties are like this?  I.e. a rule of thumb to help me in the future.
    LVL 11

    Accepted Solution

    Look up Windows Forms ActiveX Control Importer (Aximp.exe) in MSDN or Google

    It seems to have someting to do with either property visibility or naming clashes. To be honest I have really not looked into it in great depth because I came from the C++ school were I got used to accessor functions prefixed with get and set.

    Rule of Thumb:
    If you cant find it by it's old name look under set_ or get_ the importer will not remove any functionality, just rename some of it.
    A better rule of thumb is to move away from ActiveX controls on windows forms and use native controls .
    See "Considerations When Hosting an ActiveX Control on a Windows Form" in MSDN for reason why, it makes valid points about file size, security and containment.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video discusses moving either the default database or any database to a new volume.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    737 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

    19 Experts available now in Live!

    Get 1:1 Help Now