Posted on Oct 25, 2008
By now, I'm sure that everyone has seen the little shield image on a button or file:
We all know that it means that you need adminstrator rights, or to log in to an admin account in order to install something or perform some operation that only admins can do. Well recently I've been working on an install and on the auto-updating feature of Bitter, so I really wanted the ability to show this so that users immediately knew that it required admin rights. But how do you do this in C#? Well, of course, there's no simple Button.ShowShield() method or anything as easy as that. You need to import a dll and then call a method with a certain constant. Fun, eh? Anyway, I wrapped all that into a class and thought I'd share. If anyone finds any bugs or improvements let me know. Enjoy!
class ShieldButton : Button
{
Loading comments...