Arrange control array elements!

Posted on 2004-11-23
Last Modified: 2010-05-02
Greetings Experts,

How to tile 15 pictureboxes in a control array on the screen (5 pictureboxes per row, 3 such rows)? I am not able to write the exact code in form_resize.

Please help me out urgently.

Question by:codedriller
    LVL 10

    Expert Comment

    LVL 6

    Accepted Solution

    Try this ...

    Private Sub Form_Resize()
        Dim x As Single, y As Single, W As Single, H As Single
        Const R = 3
        Const C = 5
        W = Me.ScaleWidth / C
        H = Me.ScaleHeight / R
        For x = 0 To C - 1
            For y = 0 To R - 1
                Picture1(x + y * C).Move x * W, y * H, W, H
    End Sub

    Author Comment

    Thanks a million mmusante !!!

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    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 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…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    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

    22 Experts available now in Live!

    Get 1:1 Help Now