Canvasを使う cmで位置指定 WPFCanvasを使う cmで位置指定前回、FixedDocumentで使用した、Canvasですが、どうも、Left,Topをcmで指定できるらしい。 <Window x:Class="FixDocumentWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="FixDocumentWindow" Height="30cm" Width="22cm"> <Grid > <Grid.RowDefinitions> <RowDefinition/> <!--<RowDefinition/>--> </Grid.RowDefinitions> <DocumentViewer> <FixedDocument> <!--実行時に、ここに貼り付ける--> <PageContent> <FixedPage Grid.Row="1" Width="21cm" Height="29.7cm" > <Canvas> <TextBox Canvas.Left="0cm" BorderBrush="Black">Canvas.Left="0cm"</TextBox> <TextBox Canvas.Left="10cm" BorderBrush="Black">Canvas.Left="10cm"</TextBox> <TextBox Canvas.Left="10cm" Canvas.Top="5cm" BorderBrush="Black">Canvas.Left="10cm" Canvas.Top="5cm"</TextBox> </Canvas> </FixedPage> </PageContent> </FixedDocument> </DocumentViewer> <!--デザイン時はここで--> <!--<FixedPage Grid.Row="1" Width="21cm" Height="29.7cm" > <Canvas> <TextBox Canvas.Left="0cm" BorderBrush="Black">Canvas.Left="0cm"</TextBox> <TextBox Canvas.Left="10cm" BorderBrush="Black">Canvas.Left="10cm"</TextBox> <TextBox Canvas.Left="10cm" Canvas.Top="5cm" BorderBrush="Black">Canvas.Left="10cm" Canvas.Top="5cm"</TextBox> </Canvas> </FixedPage>--> </Grid> </Window> |