
4. ProgressBar, NumericUpDown
ProgressBar, NumericUpDown and More in Web Windows Forms
Progress Bar
A ProgressBar is a control that an application can use to indicate the progress of a lengthy operation such as calculating a complex equation, downloading a large file, or printing a document.
What is ProgressBar?
In Web Windows Forms, a ProgressBar is used to inform the user about the progress of a task. It provides visual feedback to the user about the status of the ongoing process.
How to use ProgressBar?
The ProgressBar.PerformStep()
method is used to increment the progress bar by the value defined in the Step property.
Here's an example of how to use ProgressBar
:
ProgressBar progressBar = new ProgressBar();
progressBar.Maximum = 100;
progressBar.Step = 10;
for(int i = 0; i < 10; i++){
progressBar.PerformStep();
}
NumericUpDown
NumericUpDown is a Windows Forms control. It is used to display numeric data, including decimal and hexadecimal numbers, and allows users to select a number by clicking an up or down button.
How to use NumericUpDown?
Here's an example of how to use NumericUpDown
:
NumericUpDown numericUpDown = new NumericUpDown();
numericUpDown.Minimum = 1;
numericUpDown.Maximum = 100;
numericUpDown.Value = 50;
TrackBar
A TrackBar is a Windows Forms control that lets you navigate through a range of values graphically, by moving a slider. It's a convenient way to select a value in a range.
StatusStrip
The StatusStrip Control replaces and adds functionality to the StatusBar Control; however, the StatusBar Control is retained for both backward compatibility and future use, if you choose.
ScrollBar
A ScrollBar control enables the user to access parts of a document that is larger than the physical area of the form. It represents a Windows scroll bar control.
UserControl
UserControl is used to design controls in a custom way. It can be added inside any other controls.
Here's an example of how to use UserControl
:
UserControl userControl = new UserControl();
userControl.BackColor = Color.Red;
Controls.Add(userControl);
GunaUI2.Winform
GunaUI2.Winform is a package available in NuGet which you can install and add to the toolbox. It provides a set of controls to build modern and professional interface for .NET Windows Form applications.
Here's an example of how to use GunaUI2.Winform
:
First, install the package:
Install-Package Guna.UI2.WinForms -Version 2.0.2.1
Then, use it in your form:
Guna.UI2.WinForms.Guna2Button button = new Guna.UI2.WinForms.Guna2Button();
button.Text = "Click Me";
Controls.Add(button);
In this lesson, we have covered several controls in Web Windows Forms, including ProgressBar, NumericUpDown, TrackBar, StatusStrip, ScrollBar, and UserControl. We have also briefly introduced the GunaUI2.Winform package.
Reference
The content in this document is based on the original notes provided in Azerbaijani. For further details, you can refer to the original document using the following link:
Original Note - Azerbaijani Version