how to get control count and location on a form

Posted on 2006-04-07
Last Modified: 2010-04-07
I have a vb6 program that I create controls on at runtime and move the controls around. When I'm done I'd like to click a button on the form that will count the controls and tell me the locations of each control(x,y coordinates) in inches if possible.

Thank you,

Question by:heydude
    1 Comment
    LVL 48

    Accepted Solution

    maybe can try like this..

    Dim ctrl As Control
        For Each ctrl In Me.Controls
            Debug.Print ctrl.Name & " (" & ctrl.Left & ", " & ctrl.Top & ") "

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    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…
    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…

    755 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