silverlight - How can I create a button in F# that contains both an image and text? -


i have both button, , image follows:

let btnfoo = new button() let imgbar = new bitmapimage(new system.uri("images/whatever.png", system.urikind.relativeorabsolute)) 

i'd button content contain text, , image.

i can either of these 2 things fine, don't me both text , image on button @ same time:

btnfoo.content <- "text" btnfoo.content <- imgbar 

neither of these things work:

btnfoo.content <- "text " + imgbar // compiler hates btnfoo.content <- "text ", imgbar // compiler ok, result ugly since image rendered class text 

i can't set background of button image:

btnfoo.background <- imgbar // compiler doesn't because background expects media.brush 

any thoughts/ideas? thanks!

you can create stackpanel , add image along textblock it's children. set stack panel buttons content. may choose other panel well.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -