Solved

SHOW IMAGES TO FLOW LAYOUT PANEL

Posted on 2011-02-12
5
771 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
  • 4
5 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

831 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