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 6839365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:42:36+00:00 2026-05-26T23:42:36+00:00

I would like to create multiple progress bars inside a grid or table through

  • 0

I would like to create multiple progress bars inside a grid or table through code (VB.Net). The layout of the structure is as follow:

Game 1      [ Progress Bar 1 ]
            Downloading 2MB of 4MB

Game 2      [ Progress Bar 2 ]
            Downloading 4MB of 5MB

Game 3      [ Progress Bar 3 ]
            Download completed

Will need to be able to update the values of selected progress bar in real time.
Should I create a new class and inside this class add an array of progress bar?


Edit:

Say I incorporate the answer suggested to use ItemsControl to display my group of progress bars inside a show_progress_page (UI). I have another download_page that is actually using WebClient DownloadFileAsync to download all the games.

How should I put the functionalities inside download_page to be able to create progress bar inside show_progress_page?

I’ve tried creating this class download_page but after it loads the UI does not show this new progress bar

Public Class download_page 
Public CollectionDownloads As New ObservableCollection(Of [DownloadAppViewModel])()

Public Sub New()
    InitializeComponent()
    Dim individualDownload As New DownloadAppViewModel()
    individualDownload.GameName = "hello"
    individualDownload.TotalSize = 20
    individualDownload.DownloadedSize = 5
    CollectionDownloads.Add(individualDownload)
End Sub

End Class
  • 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-26T23:42:37+00:00Added an answer on May 26, 2026 at 11:42 pm

    Very easy using the MVVM pattern 😉

    Create a class to represent each transfer:

    public class GameDownloadViewModel : ViewModelBase
    {
        private string _gameName;
        public string GameName
        {
            get { return _gameName; }
            set
            {
                _gameName = value;
                OnPropertyChanged("GameName");
            }
        }
    
        public string StatusText
        {
            get
            {
                if (_downloadedSize < _totalSize)
                    return string.Format("Downloading {0} MB of {1} MB", _downloadedSize, _totalSize);
                return "Download completed";
            }
        }
    
        private long _totalSize;
        public long TotalSize
        {
            get { return _totalSize; }
            set
            {
                _totalSize = value;
                OnPropertyChanged("TotalSize");
                OnPropertyChanged("Progress");
                OnPropertyChanged("StatusText");
            }
        }
    
        private long _downloadedSize;
        public long DownloadedSize
        {
            get { return _downloadedSize; }
            set
            {
                _downloadedSize = value;
                OnPropertyChanged("DownloadedSize");
                OnPropertyChanged("Progress");
                OnPropertyChanged("StatusText");
            }
        }
    
        public double Progress
        {
            get
            {
                if (_totalSize != 0)
                    return 100.0 * _downloadedSize / _totalSize;
                return 0.0;
            }
        }
    }
    

    Bind an ItemsControl to an ObservableCollection<GameDownloadViewModel>, and define the template to be used to display each item:

    <ItemsControl ItemsSource="{Binding GameDownloads}">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="200" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Row="0" Grid.Column="0"
                               Text="{Binding GameName}" >
                    <ProgressBar Grid.Row="0" Grid.Column="1"
                                 Minimum="0" Maximum="100" Value="{Binding Progress}" />
                    <TextBlock Grid.Row="1" Grid.Column="1"
                               Text="{Binding StatusText}" >
                </Grid>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
    

    When the progress changes, just update the properties of the relevant GameDownloadViewModel, and the view will be updated accordingly.

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

Sidebar

Related Questions

I would like to create a class whose methods can be called from multiple
I would like create a web service in ASP.Net 2.0 that will supports JSON.
I would like to create multiple grids and switch between them using a dropdown.
I would like to know if it is possible to create multiple bindings on
I want to create the app modular and would like to create multiple EDMX,
I would like to create a document with multiple namespaces (see Xml below). How
I would like to be able to create multiple combinations that sum to 100%,
I would like to create an email client that can access multiple IMAP mailboxes.
I would like create my own collection that has all the attributes of python
Would like to create a strong password in C++. Any suggestions? I assume it

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.