Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Button and Images
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00946621
Message ID:
00946646
Vues:
20
Shawn,

>How do i add an image to a base class button and have the image show up when i drop it on a form in the designer.
>
>Since i can't set the properties through the properties window how do i do this in code.

By default, if a button's FlatStyle property is set to FlatStyle.System (which it is in MM .NET so it picks up Windows XP styles at run time), unfortunately, this prevents the buttom from displaying an image (a Windows Forms "issue"). If you want to display an image on a button you can change the button's FlatStyle property to FlatStyle.Standard.

Also, you CAN set this property in a button subclass. Just double-click the button class in the Solution Explorer, and go to the Properties Window to set the Image property.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform