Add something new to Virb:

Virb

Are you sure you want to delete that?

or Cancel

 

Posted on Oct 25, 2008

Showing Administrator Shield on a Button

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...

Likes

Details

Viewed 5 times

© 2008 mike6024

virb.com/t/892639
tweet!

Flag this text post!

Flag this text post as:

or Cancel

 

Advertisement

Flag this profile as:

or Cancel