views:

428

answers:

2

I'm trying to use the Uniform grid control to organize several buttons (to be specific it is a calculator, and I'm trying to create the buttons from my numberpad)

I think the uniform grid is what I want to use to organize my buttons, but I can't seem to figure out how to make a button "span" multiple rows. For example the + button on most numberpads span across 2 rows.

How would I do this with the uniform grid? or should I be using something else?

I'm using visual studio 2008, a visual c# WPF project.

+4  A: 

Don't use the uniform grid, just use a regular grid:

<grid>
        <grid.columndefinitions>
            <column width = "0.333*" />
            <column width = "0.333*" />
            <column width = "0.333*" />
        </grid.columndefinitions>
        <grid.rowdefinitions>
            <row height = "0.333*" />
            <row height = "0.333*" />
            <row height = "0.333*" />
        </grid.rowdefinitions>

        <button grid.row="1" grid.column="2" grid.rowspan="2" content="+" />
</grid>
Paul Betts
+1  A: 

Your response did not directly work, but I was able to use it to figure out what I wanted, thanks

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="20" />
                <ColumnDefinition Width="20" />
                <ColumnDefinition Width="20" />
                <ColumnDefinition Width="20" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="20" />
                <RowDefinition Height="20" />
                <RowDefinition Height="20" />
                <RowDefinition Height="20" />
            </Grid.RowDefinitions>
            <Button Grid.Row="1" Grid.Column="2" Grid.RowSpan="2" Content="+" />
        </Grid>
Danny