내가하려는 것은 명시 적으로 높이/너비가 아닌 창을 표시하는 것입니다 (두 값 모두 생략되거나 Auto
으로 설정 됨). 나는 포함 된 모든 usercontrols 크기를 자동으로 계산하여 창 크기를 알아낼 것이라고 추측했지만 실제로 작동하지 않습니다! Window Height = "Auto"가 예상대로 작동하지 않습니다.
Actualwidth
과
Actualheight
값을 큰 창을 얻을 모두 512
창 선언으로 설정
:를 통해 대화로이 창을 표시<Window x:Class="Window3"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window3"
Height="Auto">
<StackPanel>
<Label>Window</Label>
</StackPanel>
</Window>
(?!?!)
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button2.Click
Dim dlg As New Window3
dlg.ShowDialog()
End Sub
해결 방법은 있습니까? 폼의 많은 컨트롤이 생성자 매개 변수를 기반으로 축소되고 폼의 실제 크기를 찾으려고하면 까다 롭고 추악 할 것이므로 내 윈도우의 크기를 명시 적으로 설정하고 싶지 않습니다.
당신은 또한'' "CenterScreen" '붙여 넣기'SizeToContent = "WidthAndHeight을"'복사 할 게으른 사람들을 위해 –