Solved

SHOW IMAGES TO FLOW LAYOUT PANEL

Posted on 2011-02-12
5
760 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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 (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

21 Experts available now in Live!

Get 1:1 Help Now