Fulvio's Blog

.NET e dintorni

  Home :: Contact :: Syndication  :: Login
  84 Posts :: 3 Stories :: 5 Comments :: 3026 Trackbacks

Some people, ask to me if it's possible to add any object into a button with windows presentation foundation.
There is no problem (of coure :D). You can use the "Content" property of Button object (yes, where you can set the text of button).
"Content" property is of type of System.Object, for this reason you can put all things you want (for example an ellipse).
The right code is :
< Name="btnProva" Click="btnProva_Click">
< Button.Content>
<Ellipse Name="fgrEllisse" Height="30" Width="40" Fill="Bisque">< /Ellipse>
< /Button.Content>
< /Button>

You can see this image to view the result of this code.
Bye

Fulvio

posted on mercoledì 26 dicembre 2007 15.46