I have both a button and an image as follows:
let btnFoo = new Button() let imgBar = new BitmapImage(new System.Uri("images/whatever.png", System.UriKind.RelativeOrAbsolute))
I want the content of the button to contain some text as well as an image.
I can do either of these two things just fine, but they don't get me both the text and the image on the button at the same time:
btnFoo.Content <- "Text" btnFoo.Content <- imgBar
None of these things work:
btnFoo.Content <- "Text " + imgBar // compiler hates this btnFoo.Content <- "Text ", imgBar // compiler is OK, but result is ugly since the image is rendered as the class text
I also can not set the button background for the image:
btnFoo.Background <- imgBar
Any thoughts / ideas? Thanks!
source share