Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6242071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:53:05+00:00 2026-05-24T11:53:05+00:00

I am trying to add Images using open file dialog and folder browse dialog

  • 0

I am trying to add Images using open file dialog and folder browse dialog and populating the image list to listbox.While adding these Images I need to show the progress bar for every image it loads.

I am trying to get that but when the value of the progress bar say something around 25 0r 40 it is stopping at that point but I need to show the progress bar until it completes the 100% and then populates the Image list.

How do I do that?

Here is my code:

    Private Sub AddImages_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddImages.Click

    If Not Directory.Exists(Application.StartupPath + "\Backup\") = True Then
        Directory.CreateDirectory(Application.StartupPath + "\Backup\")
    End If



    OpenFileDialog1.FileName = "Select a Image"
    OpenFileDialog1.Multiselect = True
    OpenFileDialog1.InitialDirectory = "C:\Users\Public\Pictures\Sample Pictures"
    OpenFileDialog1.Filter = "All Type Of Image Files|*.*|Joint Photographic Experts Group [JPEG]|*.jpg|Bitmap [BMP|*.bmp|Tagged Image File Format [TIFF]|*.tiff|Portable Network Graphics [PNG]|*.png"
    If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then

        ProgressBar2.Show()
        ProgressBar2.Step = 10
        Dim str As String
        For Each str In OpenFileDialog1.FileNames
            Load.Text = "Loading..."

            Dim fso As New FileSystemObject
            Dim MyName As String
            Dim MyExtension As String

            MyName = fso.GetFileName(CStr(str))
            MyExtension = fso.GetExtensionName(MyName)

            System.IO.File.Copy(str, Application.StartupPath + "\Backup\" + MyName & "." & MyExtension, True)

            CheckedListBox1.Items.Add(str, CheckState.Checked)
            Thumbcontrol1.AddThumbnail(str)
            Thumbcontrol1.BackgroundImage = Nothing
            CheckedListBox1.SelectedIndex = 0
            ProgressBar2.PerformStep()
        Next
        SaveProject.Enabled = True
        Delete.Enabled = True
        Edit.Enabled = True
        ClearAll.Enabled = True
        CheckAll.Enabled = True
        UncheckAll.Enabled = True
        Timer1.Stop()
        Load.Text = "Loading Completed"
    Else
    End If
    ProgressBar2.Visible = False
    Load.Text = Nothing

End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:53:07+00:00Added an answer on May 24, 2026 at 11:53 am

    Remove ProgressBar2.Step = 10 line and do this:

            Dim str As String
            Dim counter As Integer 'new!
            For Each str In OpenFileDialog1.FileNames
                Load.Text = "Loading..."
    
                Dim fso As New FileSystemObject
                Dim MyName As String
                Dim MyExtension As String
    
                MyName = fso.GetFileName(CStr(str))
                MyExtension = fso.GetExtensionName(MyName)
    
                System.IO.File.Copy(str, Application.StartupPath + "\Backup\" + MyName & "." & MyExtension, True)
    
                CheckedListBox1.Items.Add(str, CheckState.Checked)
                Thumbcontrol1.AddThumbnail(str)
                Thumbcontrol1.BackgroundImage = Nothing
                counter += 1 'new
                CheckedListBox1.SelectedIndex = 0
                ProgressBar2.Value = (counter * 100) / OpenFileDialog1.FileNames.Length 'new
            Next
    

    It does not address the problem of your not using threading, as other answers are correct to point out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to add n image to a panel using Netbeans. I dragged
I'm trying to add/change images in my project, using Microsoft Visual Studio 2008 C#.
I'm trying to open a PPTX from a specific folder using a Function within
I'm trying to add two images together using NumPy and PIL. The way I
I am trying to add an image into a document using WordML. I have
We are trying to add a list of strings to our OData service using
I'm trying to add image and file upload to my CKEditor instance (within a
I'm trying to add images to my models in my Django app. models.py class
Ok, I am trying to add one row of multiple images to a JPanel,
I'm trying to add an image to a generated html word document that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.