Solved

Looping though image controls to load photo

Posted on 2016-08-15
16
41 Views
Last Modified: 2016-08-17
Hi
I have a table which contains the file path to some photos.
On my form I have some PictureBox controls, and I can loads the photos as follows:
Private Sub Load_Photo(ByVal rowPhotos As SubmissionPhotosRow)

      picSource1.Load(rowPhotos.SubPhoto1)
      picSource2.Load(rowPhotos.SubPhoto2)
      picSource3.Load(rowPhotos.SubPhoto3)

   End Sub

Open in new window


There can be 6 photos though, and it is not required that all 6 photos be completed.
I'm trying to change the code to loop through the PictureBox controls and load a picture if there is a file specified.

 Private Sub Load_Photo(ByVal rowPhotos As SubmissionPhotosRow)

      Dim iLoop As Integer = 0
      Dim picImage As New PictureBox

      For iLoop = 1 To 6
         If Not IsDBNull(rowPhotos("SubPhoto" & iLoop)) Then
            picImage = Me.Controls.Item("picSource" & iLoop)
            picImage.Load(rowPhotos("SubPhoto" & iLoop))
         End If
      Next

   End Sub

Open in new window


However, I get "Object reference not set to an instance of an object." on the picImage.Load line
I can't seem to figure it out.
How would I solve this?
Thanks
0
Comment
Question by:jdhackett
  • 6
  • 5
  • 3
  • +1
16 Comments
 
LVL 8

Expert Comment

by:Paweł
ID: 41756427
 Private Sub Load_Photo(ByVal rowPhotos As SubmissionPhotosRow)

      Dim iLoop As Integer = 0
'here you're instantiating a new picturebox
      Dim picImage As New PictureBox

      For iLoop = 1 To 6
         If Not IsDBNull(rowPhotos("SubPhoto" & iLoop)) Then

'here you're setting the picture box to be a control with the id picSource#
'bet you that you don't have them all declared on your form.
            picImage = Me.Controls.Item("picSource" & iLoop)
            picImage.Load(rowPhotos("SubPhoto" & iLoop))
         End If
      Next

   End Sub

Open in new window


so to fix this make sure you have picturebox1 through picturebox6 on your form, or instantiate your picture box in your for loop and add it to your me.contorls

something like the following

 Private Sub Load_Photo(ByVal rowPhotos As SubmissionPhotosRow)

      Dim iLoop As Integer = 0

      

      For iLoop = 1 To 6
         If Not IsDBNull(rowPhotos("SubPhoto" & iLoop)) Then


           Dim picImage As New PictureBox
            picImage.Load(rowPhotos("SubPhoto" & iLoop))
            Me.Controls.add(picImage)
         End If
      Next

   End Sub

Open in new window


it's been years since i've touched VB, but that's the basic idea.
0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 125 total points
ID: 41756438
There could be two things on one line giving that problem
Put a breakpoint on the line:
            picImage.Load(rowPhotos("SubPhoto" & iLoop))
then run the code and check if picImage is null.  If it is not null single step and see if the code fails (which means the rowPhotos(...) is giving the problem.  Keep doing this until the code fails / you know what exactly is giving the problem.
0
 
LVL 1

Author Comment

by:jdhackett
ID: 41756462
Hi Andy
Its the picImage that is giving the problem. I added another step
stPhoto = rowPhotos("SubPhoto" & iLoop)
and that worked fine.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 41756478
Have you checked as Pawel suggested in the earlier comment?
0
 
LVL 1

Author Comment

by:jdhackett
ID: 41756485
Hi Pawel
I changed my code to your suggestion. While it now doesn't break, it doesn't display the picture either.

 If Not IsDBNull(rowPhotos("SubPhoto" & iLoop)) Then
            Dim picImage As New PictureBox

            picImage.Load(rowPhotos("SubPhoto" & iLoop))
            Me.Controls.Add(picImage)

         End If

Open in new window


It does seem that the problem was with the
    picImage = Me.Controls.Item("picSource" & iLoop)
line.
Maybe there is a different way to point picImage at picSource?
0
 
LVL 8

Expert Comment

by:Paweł
ID: 41756493
it depends on what SubmissionPhotosRow is

if it's a collection of images then
https://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox.image(v=vs.110).aspx

if it's a path, then you should stick to load
https://msdn.microsoft.com/en-us/library/f6ak7was(v=vs.110).aspx
0
 
LVL 1

Author Comment

by:jdhackett
ID: 41756515
Its a path, so I'm using picImage.Load
0
 
LVL 8

Expert Comment

by:Paweł
ID: 41756518
you're using a forms application?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 8

Expert Comment

by:Paweł
ID: 41756525
try something like this
   Dim img = New PictureBox()
        img.Load("C:\Dev\WindowsApplication1\WindowsApplication1\assets\profile-placeholder.png")

'set the size
        img.SizeMode = PictureBoxSizeMode.AutoSize

        Me.Controls.Add(img)

Open in new window


if you don't set the image size, then you might not notice the images getting added
0
 
LVL 8

Accepted Solution

by:
Paweł earned 250 total points
ID: 41756538
Also they're added on top of each other, so you'll have to use the left and top properties to position your images

Public Class Form1
    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        Dim img = New PictureBox()
        img.Load("C:\Dev\WindowsApplication1\WindowsApplication1\assets\profile-placeholder.png")
        img.SizeMode = PictureBoxSizeMode.AutoSize

        Me.Controls.Add(img)

        img = New PictureBox()
        img.Load("C:\Dev\WindowsApplication1\WindowsApplication1\assets\profile-placeholder.png")
        img.SizeMode = PictureBoxSizeMode.AutoSize
        img.Left = 200
        img.Top = 200
        Me.Controls.Add(img)

    End Sub
End Class

Open in new window

0
 
LVL 32

Assisted Solution

by:it_saige
it_saige earned 125 total points
ID: 41756725
*No Points*

Some good guidance already from Pawel and Andy.

Since you indicated that you have a form with PictureBox controls already added, you should not need to construct new PictureBox controls, rather you should loop through your existing PicutreBox controls and load images into them; e.g. -
Private Sub Load_Photo(ByVal rowPhotos As SubmissionPhotosRow)
	Dim value As String = Nothing
	For Each [property] As PropertyInfo In rowPhotos.GetType().GetProperties()
		If [property].Name.IndexOf("subphoto", StringComparison.OrdinalIgnoreCase) <> -1 Then
			value = [property].GetValue(rowPhotos, Nothing)
			If Not String.IsNullOrEmpty(value) AndAlso Not IsDBNull(value) Then
				For Each pb As PictureBox In Controls().Cast(Of Control).OrderBy(Function(c) c.Name).Where(Function(c) TypeOf c Is PictureBox)
					If pb.Image Is Nothing Then
						Try
							pb.Load(value)
						Catch ex As Exception
							'' Most likely the image could not be loaded because the path does not exist.
							'' Log your error if you wish but this will prevent the loop from breaking
						End Try
						Exit For
					End If
				Next
			End If
		End If
	Next
End Sub

Open in new window

Proof of concept -

Form1.vb -
Imports System.Reflection

Public Class Form1
	Private Sub OnLoad(sender As Object, e As EventArgs) Handles MyBase.Load
		Dim photos = New SubmissionPhotosRow() With
				   {
					   .SubPhoto1 = "c:\!quick\images\avatar.jpg",
					   .SubPhoto2 = "c:\!quick\images\data_backup.png",
					   .SubPhoto3 = "c:\!quick\images\devflow.png",
					   .SubPhoto4 = "c:\!quick\images\dialog-error.png"
				   }
		Load_Photo(photos)
	End Sub

	Private Sub Load_Photo(ByVal rowPhotos As SubmissionPhotosRow)
		Dim value As String = Nothing
		For Each [property] As PropertyInfo In rowPhotos.GetType().GetProperties()
			If [property].Name.IndexOf("subphoto", StringComparison.OrdinalIgnoreCase) <> -1 Then
				value = [property].GetValue(rowPhotos, Nothing)
				If Not String.IsNullOrEmpty(value) AndAlso Not IsDBNull(value) Then
					For Each pb As PictureBox In Controls().Cast(Of Control).OrderBy(Function(c) c.Name).Where(Function(c) TypeOf c Is PictureBox)
						If pb.Image Is Nothing Then
							Try
								pb.Load(value)
							Catch ex As Exception
								'' Most likely the image could not be loaded because the path does not exist.
								'' Log your error if you wish but this will prevent the loop from breaking
							End Try
							Exit For
						End If
					Next
				End If
			End If
		Next
	End Sub
End Class

Class SubmissionPhotosRow
	Public Property SubPhoto1() As String
	Public Property SubPhoto2() As String
	Public Property SubPhoto3() As String
	Public Property SubPhoto4() As String
	Public Property SubPhoto5() As String
	Public Property SubPhoto6() As String
End Class

Open in new window

Form1.Designer.vb -
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
		Me.PictureBox1 = New System.Windows.Forms.PictureBox()
		Me.PictureBox2 = New System.Windows.Forms.PictureBox()
		Me.PictureBox3 = New System.Windows.Forms.PictureBox()
		Me.PictureBox4 = New System.Windows.Forms.PictureBox()
		Me.PictureBox5 = New System.Windows.Forms.PictureBox()
		Me.PictureBox6 = New System.Windows.Forms.PictureBox()
		Me.Label1 = New System.Windows.Forms.Label()
		CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
		CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit()
		CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit()
		CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).BeginInit()
		CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit()
		CType(Me.PictureBox6, System.ComponentModel.ISupportInitialize).BeginInit()
		Me.SuspendLayout()
		'
		'PictureBox1
		'
		Me.PictureBox1.Location = New System.Drawing.Point(12, 29)
		Me.PictureBox1.Name = "PictureBox1"
		Me.PictureBox1.Size = New System.Drawing.Size(100, 100)
		Me.PictureBox1.TabIndex = 0
		Me.PictureBox1.TabStop = False
		'
		'PictureBox2
		'
		Me.PictureBox2.Location = New System.Drawing.Point(118, 29)
		Me.PictureBox2.Name = "PictureBox2"
		Me.PictureBox2.Size = New System.Drawing.Size(100, 100)
		Me.PictureBox2.TabIndex = 1
		Me.PictureBox2.TabStop = False
		'
		'PictureBox3
		'
		Me.PictureBox3.Location = New System.Drawing.Point(224, 29)
		Me.PictureBox3.Name = "PictureBox3"
		Me.PictureBox3.Size = New System.Drawing.Size(100, 100)
		Me.PictureBox3.TabIndex = 2
		Me.PictureBox3.TabStop = False
		'
		'PictureBox4
		'
		Me.PictureBox4.Location = New System.Drawing.Point(12, 135)
		Me.PictureBox4.Name = "PictureBox4"
		Me.PictureBox4.Size = New System.Drawing.Size(100, 100)
		Me.PictureBox4.TabIndex = 3
		Me.PictureBox4.TabStop = False
		'
		'PictureBox5
		'
		Me.PictureBox5.Location = New System.Drawing.Point(118, 135)
		Me.PictureBox5.Name = "PictureBox5"
		Me.PictureBox5.Size = New System.Drawing.Size(100, 100)
		Me.PictureBox5.TabIndex = 4
		Me.PictureBox5.TabStop = False
		'
		'PictureBox6
		'
		Me.PictureBox6.Location = New System.Drawing.Point(224, 135)
		Me.PictureBox6.Name = "PictureBox6"
		Me.PictureBox6.Size = New System.Drawing.Size(100, 100)
		Me.PictureBox6.TabIndex = 5
		Me.PictureBox6.TabStop = False
		'
		'Label1
		'
		Me.Label1.AutoSize = True
		Me.Label1.Location = New System.Drawing.Point(13, 13)
		Me.Label1.Name = "Label1"
		Me.Label1.Size = New System.Drawing.Size(45, 13)
		Me.Label1.TabIndex = 6
		Me.Label1.Text = "Pictures"
		'
		'Form1
		'
		Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
		Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
		Me.ClientSize = New System.Drawing.Size(337, 254)
		Me.Controls.Add(Me.Label1)
		Me.Controls.Add(Me.PictureBox6)
		Me.Controls.Add(Me.PictureBox5)
		Me.Controls.Add(Me.PictureBox4)
		Me.Controls.Add(Me.PictureBox3)
		Me.Controls.Add(Me.PictureBox2)
		Me.Controls.Add(Me.PictureBox1)
		Me.Name = "Form1"
		Me.Text = "Form1"
		CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
		CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit()
		CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).EndInit()
		CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).EndInit()
		CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).EndInit()
		CType(Me.PictureBox6, System.ComponentModel.ISupportInitialize).EndInit()
		Me.ResumeLayout(False)
		Me.PerformLayout()

	End Sub
	Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
	Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
	Friend WithEvents PictureBox3 As System.Windows.Forms.PictureBox
	Friend WithEvents PictureBox4 As System.Windows.Forms.PictureBox
	Friend WithEvents PictureBox5 As System.Windows.Forms.PictureBox
	Friend WithEvents PictureBox6 As System.Windows.Forms.PictureBox
	Friend WithEvents Label1 As System.Windows.Forms.Label

End Class

Open in new window

Source images -Capture.JPGProduces the following output -Capture.JPG
I would, however, recommend a couple of changes.

First instead of using just picture box controls, I personally, would use a FlowLayout Panel and add my picture boxes to it; e.g. -

Form1.vb -
Imports System.Reflection

Public Class Form1
	Private Sub OnLoad(sender As Object, e As EventArgs) Handles MyBase.Load
		Dim photos = New SubmissionPhotosRow() With
				   {
					   .SubPhoto1 = "c:\!quick\images\avatar.jpg",
					   .SubPhoto2 = "c:\!quick\images\data_backup.png",
					   .SubPhoto3 = "c:\!quick\images\devflow.png",
					   .SubPhoto4 = "c:\!quick\images\dialog-error.png"
				   }
		Load_Photo(photos)
	End Sub

	Private Sub Load_Photo(ByVal rowPhotos As SubmissionPhotosRow)
		Dim value As String = Nothing
		For Each [property] As PropertyInfo In rowPhotos.GetType().GetProperties()
			If [property].Name.IndexOf("subphoto", StringComparison.OrdinalIgnoreCase) <> -1 Then
				value = [property].GetValue(rowPhotos, Nothing)
				If Not String.IsNullOrEmpty(value) AndAlso Not IsDBNull(value) Then
					Dim pb As New PictureBox() With {.Height = 100, .Width = 100}
					Try
						pb.Load(value)
						FlowLayoutPanel1.Controls.Add(pb)
					Catch ex As Exception
						'' Most likely the image could not be loaded because the path does not exist.
						'' Log your error if you wish but this will prevent the loop from breaking
					End Try
				End If
			End If
		Next
	End Sub
End Class

Class SubmissionPhotosRow
	Public Property SubPhoto1() As String
	Public Property SubPhoto2() As String
	Public Property SubPhoto3() As String
	Public Property SubPhoto4() As String
	Public Property SubPhoto5() As String
	Public Property SubPhoto6() As String
End Class

Open in new window

Form1.Designer.vb -
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
		Me.Label1 = New System.Windows.Forms.Label()
		Me.FlowLayoutPanel1 = New System.Windows.Forms.FlowLayoutPanel()
		Me.SuspendLayout()
		'
		'Label1
		'
		Me.Label1.AutoSize = True
		Me.Label1.Location = New System.Drawing.Point(13, 13)
		Me.Label1.Name = "Label1"
		Me.Label1.Size = New System.Drawing.Size(45, 13)
		Me.Label1.TabIndex = 6
		Me.Label1.Text = "Pictures"
		'
		'FlowLayoutPanel1
		'
		Me.FlowLayoutPanel1.Location = New System.Drawing.Point(16, 30)
		Me.FlowLayoutPanel1.Name = "FlowLayoutPanel1"
		Me.FlowLayoutPanel1.Size = New System.Drawing.Size(309, 212)
		Me.FlowLayoutPanel1.TabIndex = 7
		'
		'Form1
		'
		Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
		Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
		Me.ClientSize = New System.Drawing.Size(337, 254)
		Me.Controls.Add(Me.FlowLayoutPanel1)
		Me.Controls.Add(Me.Label1)
		Me.Name = "Form1"
		Me.Text = "Form1"
		Me.ResumeLayout(False)
		Me.PerformLayout()

	End Sub
	Friend WithEvents Label1 As System.Windows.Forms.Label
	Friend WithEvents FlowLayoutPanel1 As System.Windows.Forms.FlowLayoutPanel

End Class

Open in new window

From the same image set as above, produces the following output -Capture.JPG
Second, I would personally use a list of strings for the paths instead of depending upon the property name as you could have additional properties that include the name; e.g. -
Imports System.Reflection

Public Class Form1
	Private Sub OnLoad(sender As Object, e As EventArgs) Handles MyBase.Load
		Dim photos = New SubmissionPhotosRow() With
				   {
					   .ImagePaths = New List(Of String) From {"c:\!quick\images\avatar.jpg", "c:\!quick\images\data_backup.png", "c:\!quick\images\devflow.png", "c:\!quick\images\dialog-error.png"}
				   }
		Load_Photo(photos)
	End Sub

	Private Sub Load_Photo(ByVal rowPhotos As SubmissionPhotosRow)
		For Each [path] In rowPhotos.ImagePaths
			If Not String.IsNullOrEmpty([path]) AndAlso Not IsDBNull([path]) Then
				Dim pb As New PictureBox() With {.Height = 100, .Width = 100}
				Try
					pb.Load([path])
					FlowLayoutPanel1.Controls.Add(pb)
				Catch ex As Exception
					'' Most likely the image could not be loaded because the path does not exist.
					'' Log your error if you wish but this will prevent the loop from breaking
				End Try
			End If
		Next
	End Sub
End Class

Class SubmissionPhotosRow
	Public Property ImagePaths() As New List(Of String)
End Class

Open in new window

If you do not wish to use a list of strings for paths that is fine, we could simply add a list of properties to look for in order to ensure that we get the right properties; e.g. -

Using PictureBox controls -
Private Sub Load_Photo(ByVal rowPhotos As SubmissionPhotosRow)
	Dim value As String = Nothing
	Dim photoProperties = {"subphoto1", "subphoto2", "subphoto3", "subphoto4", "subphoto5", "subphoto6"}
	For Each [property] As PropertyInfo In rowPhotos.GetType().GetProperties()
		If photoProperties.Contains([property].Name, StringComparer.OrdinalIgnoreCase) Then
			value = [property].GetValue(rowPhotos, Nothing)
			If Not String.IsNullOrEmpty(value) AndAlso Not IsDBNull(value) Then
				For Each pb As PictureBox In Controls().Cast(Of Control).OrderBy(Function(c) c.Name).Where(Function(c) TypeOf c Is PictureBox)
					If pb.Image Is Nothing Then
						Try
							pb.Load(value)
						Catch ex As Exception
							'' Most likely the image could not be loaded because the path does not exist.
							'' Log your error if you wish but this will prevent the loop from breaking
						End Try
						Exit For
					End If
				Next
			End If
		End If
	Next
End Sub

Open in new window

Using a FlowLayoutPanel control -
Private Sub Load_Photo(ByVal rowPhotos As SubmissionPhotosRow)
	Dim value As String = Nothing
	Dim photoProperties = {"subphoto1", "subphoto2", "subphoto3", "subphoto4", "subphoto5", "subphoto6"}
	For Each [property] As PropertyInfo In rowPhotos.GetType().GetProperties()
		If photoProperties.Contains([property].Name, StringComparer.OrdinalIgnoreCase) Then
			value = [property].GetValue(rowPhotos, Nothing)
			If Not String.IsNullOrEmpty(value) AndAlso Not IsDBNull(value) Then
				Dim pb As New PictureBox() With {.Height = 100, .Width = 100}
				Try
					pb.Load(value)
					FlowLayoutPanel1.Controls.Add(pb)
				Catch ex As Exception
					'' Most likely the image could not be loaded because the path does not exist.
					'' Log your error if you wish but this will prevent the loop from breaking
				End Try
			End If
		End If
	Next
End Sub

Open in new window


-saige-
1
 
LVL 1

Author Comment

by:jdhackett
ID: 41759194
Hi
Thanks everyone for their replies.
This is the code that worked for me, which I wrote before reading it_saiges excellent post above.
The previous problem was I had was actually due to the PictureBox being on a tab page, so I have to use Me.tabSource.Controls

  Private Sub Load_Photo(ByVal rowPhotos As SubmissionPhotosRow)
      ' Row has fields SubPhoto1 to 6, which is the path to the photo
      ' Also show the Size of the photo in Kb

      Dim iLoop As Integer = 0
      Dim picImage As New PictureBox
      Dim stPhoto As String = ""
      Dim infoReader As System.IO.FileInfo

      For iLoop = 1 To 6
         If Not IsDBNull(rowPhotos("SubPhoto" & iLoop)) Then

            stPhoto = rowPhotos("SubPhoto" & iLoop)

            picImage = CType(Me.tabSource.Controls("picSource" & iLoop), PictureBox)
            picImage.Load(stPhoto)

            infoReader = My.Computer.FileSystem.GetFileInfo(stPhoto)
            tabSource.Controls("txtSize" & iLoop).Text = Math.Round(infoReader.Length / 1024, 0)

         End If
      Next

   End Sub

Open in new window


Reading the above solutions, I see that I should of course add error checking. And better checking for nulls.
In my case, I had 6 PictureBox controls, I had not thought about FlowControl panels.
Are there advantages to using the FlowControl panels?
0
 
LVL 32

Expert Comment

by:it_saige
ID: 41759290
The one advantage that sticks out in my head is that you no longer have to worry about the number of images you need to display; e.g. - We need to support the display of 9 images.

Rather than having to recompile the program to add the controls and their management to the form, you just add the properties to the class or better yet, if you decided to implement the list of strings, you just add the paths to your datasource.

The FlowLayoutPanel will also lend itself to resizing easier than using just a set of Picturebox controls.

-saige-
1
 
LVL 1

Author Comment

by:jdhackett
ID: 41759376
Thanks, you've been a great help.

One last thing - what do you mean by *No points* above?
0
 
LVL 32

Expert Comment

by:it_saige
ID: 41759401
It's a way of signifying that I do not expect any points from that submission because I feel that Andy and Pawel had already answered your original question, i simply provided enhancement based guidance.

If you disagree you can still chose to assign points to my answer, but I would not overlook the submissions provided by Andy and Pawel.

-saige-
0
 
LVL 1

Author Comment

by:jdhackett
ID: 41759479
Thanks, that's what I thought, but I wanted to make sure.
I feel you should get some points though as your answer was very helpful.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

17 Experts available now in Live!

Get 1:1 Help Now