Link to home
Start Free TrialLog in
Avatar of rushtheweb
rushtheweb

asked on

Creating a circular progress bar...

I want to make a custom progress bar which would be almost a complete circle.

An example in c++ is http://www.codeguru.com/cpp/misc/misc/system/article.php/c11679/

Is this easily doable with c#?

Thanks
Avatar of AlexFM
AlexFM

Windows hooks are not part of .NET. This can be done in C#, but 99% of code must be written using API PInvoke code. I think it can be done better in C++/CLI, which allows direct API calls without PInvoke.
Actually, you can write C++/CLI Class Library, add files MousePrg.cpp, MousePrg.h, MousePrgVars.h, and MousePrgHook.h to it and use CMousePrg class directly from C++/CLI code.
Avatar of rushtheweb

ASKER

Im not looking to have it recreated like that example (mouse following and what not); Im just hoping to make something similar to put on a form for not only a visual element but also as a space saver. I appreciate your comments! :)
ASKER CERTIFIED SOLUTION
Avatar of dstanley9
dstanley9

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Awesome, ill give it a shot... can you tell me what to define pe as?

Thanks
Scratch that I wasnt paying attention! :)
Awesome, it seems to be working. I will have to play with it and figure out how to do a border to make it look more like a progress bar and change the direction to counter clockwise and then I think its perfect! If you have any more tips toward my goal I would really appreciate them. :)
To go counterclockwise, just use a negative 4th parameter to DrawArc:

g.DrawArc(pen,rec,startAngle,-360.0f * percent);