Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

Which control to use

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amil - 09 Oct 2004 15:39 GMT
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.
Justin Rogers - 10 Oct 2004 00:51 GMT
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.

Signature

Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

> 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.
Fluxray - 14 Oct 2004 10:29 GMT
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.

> 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
[quoted text clipped - 10 lines]
> > 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.