Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SHOW IMAGES TO FLOW LAYOUT PANEL

Posted on 2011-02-12
5
Medium Priority
?
790 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

618 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