8

VS 2005 SP3

I have worked with the progress bar many times.

However, I need to have one that is vertical. However, I can't find any property that will rotate it.

Is the progress bar always in a horizontal position and cannot be changed.

Many thanks,

ant2009
  • 27,094
  • 154
  • 411
  • 609

1 Answers1

19

Try this:

 public class VerticalProgressBar : ProgressBar { 
   protected override CreateParams CreateParams { 
    get { 
      CreateParams cp = base.CreateParams; 
      cp.Style |= 0x04; 
      return cp; 
    } 
  } 
}

From: MSDN Forums

chrissr
  • 9,861
  • 2
  • 29
  • 30
  • 9
    For those wondering, 0x04 is the PBS_VERTICAL constant, defined in the commctrl.h header file in the Windows SDK. – Scott Dorman Aug 17 '09 at 03:06