[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SHOW IMAGES TO FLOW LAYOUT PANEL

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
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 …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

872 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