0
크기가 조정되는 응용 프로그램을 기반으로 크기가 모두 변경되는 표 안에 여러 개의 단추가 있습니다. 일부 버튼에는 타원이나 직사각형과 같은 하위 요소가 있습니다. 나는 이것들을 사이즈 변경하는 것처럼 보이지 않는다.버튼 크기 변경시 자식 요소 자동 크기 조정
<Grid DockPanel.Dock="Right" Width="121">
<Grid.RowDefinitions>
<RowDefinition Height="121*" />
<RowDefinition Height="121*" />
// Snip
</Grid.RowDefinitions>
<Button Name="ellipseButton" PreviewMouseDown="EllipseButtonClickedEvent" HorizontalAlignment="Stretch" Grid.Row="0">
<Ellipse Width="90" Height="90" Stroke="Black"></Ellipse>
</Button>
// Snip
</Grid>
내가 타원의 높이와 너비가 명시 적으로 설정되어 있는지 알고 있지만 나는 것을 제거 할 때, 나는 전혀 보여 타원을 얻을 수없는 것 : 여기
몇 가지 코드입니다.나는 모든 조언을 부탁드립니다.
감사합니다. 답에 대한
<Button Name="ellipseButton" PreviewMouseDown="EllipseButtonClickedEvent" HorizontalAlignment="Stretch" Grid.Row="0"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
<Ellipse Stroke="Black" />
</Button>
감사합니다,하지만 난 내 버튼이 점을 복사 할 때 타원이 사라집니다 : –
이러한 바인딩은 불필요하므로 중요한 것은 버튼의 ContentAlignment입니다. –
@ H.B. 그렇습니다. 바인딩은 필요하지 않습니다. 내 대답 –