?
Solved

SHOW IMAGES TO FLOW LAYOUT PANEL

Posted on 2011-02-12
5
Medium Priority
?
785 Views
Last Modified: 2012-05-11
Hi All,

I want to show images to flow layout panel and I want to show its file name for each the images shown, like under its image we show the its file name.

How could I do it ?

Thank you.
0
Comment
Question by:emi_sastra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 34881263
For each image, create a dynamic panel.  Inside the panel, dock a label to the bottom with autosize set to false, and a picturebox afterwards with dock set to fill.  Now add the panel to the FlowLayoutPanel.

Where are the images coming from?
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 34881281
Hi Idle_Mind,

- For each image, create a dynamic panel.  Inside the panel, dock a label to the bottom with autosize set to false, and a picturebox afterwards with dock set to fill.  Now add the panel to the FlowLayoutPanel.
I don't get this, would you please provide sample ?

-Where are the images coming from?
It came from folder.

Thank you.
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 34881284
Below how I the folder images.


  Dim di As New IO.DirectoryInfo(strDataFolder)
            Dim aryFi As IO.FileInfo() = di.GetFiles("*.*")

            For Each fi As IO.FileInfo In aryFi

                If Func.Is_Valid_Image_File(fi.Extension) Then

                    Image1 = System.Drawing.Image.FromFile(fi.FullName)
                Endif

             Next

Thank you.
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 34881347
Please see below code.

  Private Sub Form_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Try

            Dim di As New IO.DirectoryInfo(strDataFolder)
            Dim aryFi As IO.FileInfo() = di.GetFiles("*.*")

            For Each fi As IO.FileInfo In aryFi

                If Func.Is_Valid_Image_File(fi.Extension) Then

                    Image1 = System.Drawing.Image.FromFile(fi.FullName)

                    With Me.flpProfileBan

                        Dim pnl As Panel = New Panel
                        pnl.Name = fi.FullName

                        Dim pct As PictureBox = New PictureBox
                        pct.Name = fi.Name
                        pct.SizeMode = PictureBoxSizeMode.StretchImage

                        Dim lbl As Label = New Label
                        lbl.Text = fi.Name

                        With pnl
                            .Controls.Add(pct)
                            .Controls.Add(lbl)

                            pct.Image = Image1
                        End With

                        .Controls.Add(pnl)

                    End With

                End If
            Next

        Catch ex As Exception

        End Try

    End Sub

How to add text to panel ?

Thank you.
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 34881353
Hi Idle_Mind,

I get it.

Thank you very much for your help.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

743 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