locked
How to make the button of this style? RRS feed

  • Question

  • How to make the button of this style?

    i don't want to overlap image files on the button, but i want to use different size and font of text on the button.

    Wednesday, November 12, 2014 12:51 AM

Answers

  • You can display anything you want inside a Button. Put it in the Content property.

    <Button>
        <Button.Content>
            <StackPanel> <!-- or Grid, Canvas, etc-->
                <TextBlock/>
                <TextBlock/>
                <TextBlock/>
            </StackPanel>
        </Button.Content>
    </Button>

    Wednesday, November 12, 2014 4:13 AM

All replies

  • Hey estmob,

    Why do you want this to be a button? 

    You can easily achieve this by using some TextBlocks within a Grid, and you can make use of OnTapped Event of Grid.

    If you are going to use the same style for multiple scenarios, better you create a UserControl and pass some parameter so that you can vary the content.


    Pradeep AJ

    Wednesday, November 12, 2014 3:13 AM
  • You can display anything you want inside a Button. Put it in the Content property.

    <Button>
        <Button.Content>
            <StackPanel> <!-- or Grid, Canvas, etc-->
                <TextBlock/>
                <TextBlock/>
                <TextBlock/>
            </StackPanel>
        </Button.Content>
    </Button>

    Wednesday, November 12, 2014 4:13 AM