gpwizg
Last Updated: February 25, 2016
·
828
· davidcorne
9a89b78a361d15af106a918684ff8e1d

WPF control with fixed place buttons

By this I mean you want a scalable WPF control which has controls which stay in the same place the background. For instance buttons on the same place on an image. This is important with different monitor resolutions etc.

Use a Canvas inside a Viewbox! For example a button on an image.

<Viewbox Stretch="Uniform">
      <Grid>
        <Image Source="Foot.png"/>
        <Canvas Name="KeyPointsFoot">
          <Button Background="Transparent" Canvas.Left="168" Canvas.Top="418" Width="80" Height="80">
            <Button.Content>
              <Image Source="Button.png"/>
            </Button.Content>
          </Button>
        </Canvas>
      </Grid>
    </Viewbox>

There is an example project here

Say Thanks
Respond
Awesome Job

C7a484d2 f24c 11e7 9f8c 3b9e5e589026
Junior Front-end Web Developer
·
Idaho Falls, Idaho or Remote
·
Full Time