[C#/WINFORM/DEVEXPRESS] ProgressBarControl 클래스 : 값 증가시키기
■ ProgressBarControl 클래스에서 값을 증가시키는 방법을 보여준다. ▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
using System; using System.Threading; using DevExpress.XtraEditors; #region 값 증가시키기 - IncreaseValue(progressBarControl) /// <summary> /// 값 증가시키기 /// </summary> /// <param name="progressBarControl">ProgressBarControl 객체</param> private void IncreaseValue(ProgressBarControl progressBarControl) { progressBarControl.Position = progressBarControl.Properties.Minimum; double currentStep = (progressBarControl.Properties.Maximum - progressBarControl.Properties.Minimum) / 4d; while(progressBarControl.Position + currentStep < progressBarControl.Properties.Maximum) { progressBarControl.Increment((int)Math.Ceiling(currentStep)); progressBarControl.Update(); Thread.Sleep(100); currentStep /= 1.5d; } } #endregion |