Which control to use

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I want to create a user control that is irregularly shaped (ex. star) and I
want to be able to fill the control with color based on a percentage. The
color fill will be 10% filled; 50% filled from the bottom, etc. Is there a
quick way to do this? I prefer not to use GDI+ if at all possible.
 
There certainly aren't any controls that do that, and you'd probably want
to use GDI+ in order to do your *fill*. Your quickest way to do this will
be to forget about an irregularly shaped control (from a clipping standpoint)
unless you need the background to show through, and create a GraphicsPath
in your appropriate shape. With the path defined you can mix DrawPath/FillPath
calls to get your desired look and feel. A LinearGradientBrush will allow you to
create your percentage cut-off.
 
You want a simple way? Just draw some bmp images of that shape with different
filling level and use the image as background of the control. :p will take
you some time to draw those images with photoshop if you r not good at it.
 
Back
Top