using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ProgressBar { class Vumetre : System.Windows.Forms.ProgressBar { System.Windows.Forms.Label textVumetre = new System.Windows.Forms.Label(); public System.Windows.Forms.Label TextVumetre { get { return textVumetre; } set { textVumetre = value; } } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace ProgressBar { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Vumetre progressBar = new Vumetre(); progressBar.Width = 100; progressBar.Height = 10; progressBar.Location = new Point(30, 35); this.Controls.Add(progressBar); // Set Minimum to 1 to represent the first file being copied. progressBar.Minimum = 1; // Set Maximum to the total number of files to copy. progressBar.Maximum = 10; // Set the initial value of the ProgressBar. progressBar.Value = 1; // Set the Step property to a value of 1 to represent each file being copied. progressBar.Step = 1; // Loop through all files to copy. for (int x = 1; x <= 10; x++) { // Perform the increment on the ProgressBar. progressBar.PerformStep(); System.Threading.Thread.Sleep(1000); } } } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question