FlowPanelLayout Help

Posted on 2010-01-08
Last Modified: 2012-05-08
I have the code below that runs on a counter that once it hits 64 buttons on flowpanellayout1 it then adds the rest to flowpanellayout2 what I want to do is have 4 flowpanellayout's and add 64 buttons on each one.

My question is I have managed to split it onto 2 panels but how can I do it for 4 panels?
Dim con As New SqlConnection(My.Settings.Constr)


        Dim cmd As New SqlCommand("SELECT * FROM tblCostumes WHERE master = '0' order by id", con)

        Dim reader As SqlDataReader = cmd.ExecuteReader()

        Dim counter As Integer = 0

        While reader.Read()

            counter += 1

            Dim btn As New Button

            btn.Name = "Button" & reader("id")

            btn.Width = 116

            btn.Height = 76

            btn.Tag = reader("name")

            btn.Text = reader("name")

            AddHandler btn.Click, AddressOf GetProductDetails

            If counter < 64 Then




            End If

        End While

Open in new window

Question by:richard_gar
    1 Comment
    LVL 85

    Accepted Solution

    You could do:

                Select Case counter \ 64 ' Integer Division
                    Case 0
                    Case 1
                    Case 2
                    Case 3
                End Select

    LOTS of other ways to do it....

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    I'm currently working for a company where I have to upgrade over 50 VB6 programs to VB.NET 2008.  So far I'm about half way through, and I've learned quite a few tricks that drastically improve the performance of VB.NET apps. Because there are a…
    Article by: jpaulino
    XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    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

    22 Experts available now in Live!

    Get 1:1 Help Now