WPFが初めてです。私はListBoxだけでなく、ラベルの束とWPFウィンドウを持っています。WPF/XAML - テキストサイズをウィンドウサイズにスケーリングする
ウィンドウのサイズを変更するときに、ラベルの一部のサイズを拡大したいが、すべてではない。私は、リストボックスのいずれかを拡大することを望まない - ちょうどいくつかのラベル。
私は、ウィンドウのサイズ変更に合わせてViewboxを使ってサイズを変更することができますが、私はそれを使いこなすだけで希望の効果を得ることはできません。もちろん、すべてをサイズ変更するのでViewboxで全体を囲むことはできないので、拡大したい各ラベルを囲むウィンドウ全体にさまざまなViewboxをドロップする必要があると考えました。しかし、もちろん...私がこれを行うときには何も拡大しない。
同じ行に沿って、ラベルを展開すると、識別子であるため、これらのラベルのすぐ隣に残る必要がある他のラベルがあります。
だからここにあるXAMLがあります。私が正しい道にいるかどうかわからない。それらの中の数字でラベルを作る助けがあれば、窓が広がることに感謝します。
<Window x:Class="WpfApplication7.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication7"
Title="Window1">
<StackPanel Orientation="Horizontal">
<ListBox Margin="2">
<ListBoxItem>a</ListBoxItem>
<ListBoxItem>b</ListBoxItem>
<ListBoxItem>c</ListBoxItem>
</ListBox>
<StackPanel Orientation="Vertical">
<Label>Title</Label>
<StackPanel Orientation="Horizontal">
<Grid>
<Grid.RowDefinitions><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/></Grid.RowDefinitions>
<Label Grid.Row="0">A</Label>
<Label Grid.Row="1">B</Label>
<Label Grid.Row="2">C</Label>
<Label Grid.Row="3">D</Label>
</Grid>
<Grid>
<Grid.RowDefinitions><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/></Grid.RowDefinitions>
<Viewbox Grid.Row="0" Stretch="Fill">
<Label>1</Label>
</Viewbox>
<Viewbox Grid.Row="1" Stretch="Fill">
<Label>2</Label>
</Viewbox>
<Viewbox Grid.Row="2" Stretch="Fill">
<Label>3</Label>
</Viewbox>
<Viewbox Grid.Row="3" Stretch="Fill">
<Label>4</Label>
</Viewbox>
</Grid>
<Grid>
<Grid.RowDefinitions><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/></Grid.RowDefinitions>
<Viewbox Grid.Row="0" Stretch="Fill">
<Label>5</Label>
</Viewbox>
<Viewbox Grid.Row="1" Stretch="Fill">
<Label>6</Label>
</Viewbox>
<Viewbox Grid.Row="2" Stretch="Fill">
<Label>7</Label>
</Viewbox>
<Viewbox Grid.Row="3" Stretch="Fill">
<Label>8</Label>
</Viewbox>
</Grid>
<Grid>
<Grid.RowDefinitions><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/></Grid.RowDefinitions>
<Label Grid.Row="0">E</Label>
<Label Grid.Row="1">F</Label>
<Label Grid.Row="2">G</Label>
<Label Grid.Row="3">H</Label>
</Grid>
</StackPanel>
</StackPanel>
</StackPanel>
</Window>
はあなたのための私の修正作業をしましたか?あなたはまだ答えを選んでいません。 – Charlie