Visual Studioの相対パネルレイアウトで同じアプリケーションを使用するために2つのボタンを作成しようとしていますが、リソースは見つけられません。何か私にこれを行う方法を示すために。ユニバーサルWindowsプラットフォームでアプリケーションの画面幅の半分を共有するボタンを2つ取得する方法
いずれかの人が手伝ってくれますか?提案なしでこの質問をダウングレードしないでください。
Visual Studioの相対パネルレイアウトで同じアプリケーションを使用するために2つのボタンを作成しようとしていますが、リソースは見つけられません。何か私にこれを行う方法を示すために。ユニバーサルWindowsプラットフォームでアプリケーションの画面幅の半分を共有するボタンを2つ取得する方法
いずれかの人が手伝ってくれますか?提案なしでこの質問をダウングレードしないでください。
のはここRelativePanel
と解決策だがかかります@ al1Dimaによって提示されたGrid
ソリューションも有効です
<RelativePanel>
<Button x:Name="LeftButton" Content="Left" HorizontalAlignment="Stretch"
RelativePanel.AlignLeftWithPanel="True" RelativePanel.LeftOf="Divider" />
<Border x:Name="Divider" RelativePanel.AlignHorizontalCenterWithPanel="True"/>
<Button x:Name="RightButton" Content="Right" HorizontalAlignment="Stretch"
RelativePanel.AlignRightWithPanel="True" RelativePanel.RightOf="Divider" />
</RelativePanel>
なぜ使用しないでくださいGrid
?
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<Grid.ColumnDefinitions>
<Button Grid.Column="0"/>
<Button Grid.Column="1"/>
</Grid>
これらの2つのボタンがGrid
のWidth
の50%を取得します。
またGrid
のWidth
の2/5がかかります。この
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*"/>
<Grid.ColumnDefinitions>
<Button Grid.Column="0"/>
<Button Grid.Column="1"/>
</Grid>
だから、最初Button
のような列を定義することができますし、他の一つは3/5 Width
あなたはいくつかのコードあなたは何を試しましたか? 希望の結果の画像は、 – ad1Dima
私は理解すると思います。なぜグリッドを使用しないのですか? – ad1Dima