Skip to Main Content
Visual Basic 2015 Unleashed
book

Visual Basic 2015 Unleashed

by Alessandro Del Sole
July 2015
Intermediate to advanced content levelIntermediate to advanced
1300 pages
87h 27m
English
Sams
Content preview from Visual Basic 2015 Unleashed

Showing the Progress of an Operation with the ProgressBar Control

The ProgressBar control requires you to set some start properties, such as Minimum, Maximum, and Value. Then you can increase the value at runtime. The following XAML code declares a ProgressBar:

<ProgressBar Name="ProgressBar1" Height="30"             Value="0"             Minimum="0" Maximum="10000"/>

To update the progress value, a good approach is making this asynchronously. This can be accomplished by invoking the Dispatcher, which is the WPF object responsible for managing threads. This points to the ProgressBar.SetValue to update the progress value. So the first step is to create a custom delegate that matches SetValue’s signature:

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Visual Basic 2015

Beginning Visual Basic 2015

Bryan Newsome

Publisher Resources

ISBN: 9780134196664Purchase book